I have to use inheriantce 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 = fW).
Consider flat bed (B), box (X), and tank (T) cars.
The volume for each type of car is B (10m³), X (20m³), T (15m³).
Read the type of car and density (in kN/m³) 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
I'm sooooo confused can someone please help me?