A+ Work





use inheritance and polymorphism to calculate the force required to pull (at a constant velocity) and the weight of material that can be carried by a train consisting of many different types of cars. The weight (W) and rolling friction coefficient ( f ) can be used to compute the force (F  f W). Consider flat bed (B), box (X), and tank (T) cars. The volume for each type of car is B (10 m3), X (20 m3), and T (15 m3). Read the type of car and density (in kN/m3) of material being carried. A sample data file (train.dat) is B 5.3 X 6.7 X 5.6 X 7.3 T 9.8 T 8.4 T 10.3 B 3.2 B 4.2.