Hello. I am creating a new train. The name of this train car is BlueTrainCar.
This car weighs 30 pounds.
The type of this train car is engine.
I am asking the weight of BlueTrainCar and it will tell me:
I weigh 30 lbs.
I am now adding another train car to BlueTrainCar.
A new train car was added to the back with a name of RedTrainCar which weighs 50 lbs and is a passenger train car.
I am now going to ask the train for its weight and the number of train cars it has and it will tell me:
This is now the total weight of the train: 80 lbs
The number of train cars now is: 2
I am now adding another train car to the train.
A new train car was added to the back with a name of GreenTrainCar which weighs 100 lbs and is a cargo train car.
I am now going to ask the train for its weight and the number of train cars it has and it will tell me:
This is now the total weight of the train: 180 lbs
The number of train cars now is: 3
The above should demonstrate the adding of traincars to the train and the train's response regarding its attributes. I am now going to be removing the train cars and asking the same questions to the train until only one train car is left.
I am now removing GreenTrainCar. The train will then tell us its total weight and the number of train car(s) it possesses.
The total weight of the train is now: 80 lbs
The total number of cars the train now has is: 2
I am now removing RedTrainCar. The train will then tell us its total weight and the number of train car(s) it possesses.
The total weight of the train is now: 30 lbs
The total number of cars the train now has is: 1
I am now trying to remove BlueTrainCar and ask the train the same questions as before. The train will then say it cannot remove the last and only train car and give the answer as to the weight and number of cars of the train.
This is the last and only train car. I cannot remove anymore!
The total weight of the train is now: 30 lbs
The total number of cars the train now has is: 1