EECE 7374 Programming Assignment 2 Reliable Transport Protocols 传输协议代写 You should work on this assignment individually or in a team of two members. One submission per team. 1.Object...View details
CISC_2000 Final Lab
c++作业代写 CISC_2000 Final Lab A set of classes is used to handle different vehicle types. The class hierarchy is shown in the following diagram.
A set of classes is used to handle different vehicle types. The class hierarchy is shown in the following diagram.
The provided abstract class Vehicle has one protected string variable vin.
virtual void print() = 0;
#endif // VEHICLE_H_INCLUDED
Three additional classes are used to represent the different types of vehicles and are described below.
Has member variable:
The Car class constructor takes two parameters representing the vin and the age in years.
The tax is $100 if the car’s age is 3 or less years, $50 if more than 3.
Function print() prints the details as shown with prefix “Car”.
Has member variables:
The Truck class constructor takes two parameters representing the vin and the weight of the vehicle.
The tax rate taxRate2000=0.12 $ per pound if the vehicle weighs 2000 pounds or less and taxRateOver2000= $0.17 $ per each additional pound over 2000 pounds.
The Truck class has function setTaxRate(double txr1, double txr2) to allow the taxRate to be modified. For example: setTaxRate(0.10,0.15) would change taxRate2000 and taxRateOver2000 to 0.10 and 0.15 respectively.
Function print() prints the details as shown with prefix “Truck”.
Tank Truck c++作业代写
A truck that carries liquids, has no member variables at all. The tax is 20% less than that of a regular truck.
The TankTruck class constructor takes two parameters representing the vin and the weight of the vehicle.
If the tax rates for Truck class changes, the TankTruck tax should continue to be computed correctly with no code modifications to the TankTruck class.
Function print() prints the details as shown with prefix “Tank Truck”.
Provided test program creates 6 vehicles:
TankTruck tanktruck_2("TNKTRK2_3456789", 2100);
It places them in an array of Vehicle objects and prints their details.
Car Vin: CAR1_3123123123 Age: x Tax: xxx Car Vin: CAR2_1231231234 Age: x Tax: xxx Truck Vin: TRK1_3123123123 Weight: xxxx Tax: xxx Truck Vin: TRK2_4567890123 Weight: xxxx Tax: xxx Tanker Vin: TNKTRK1_3123456 Weight: xxxx Tax: xxx Tanker Vin: TNKTRK2_3456789 Weight: xxxx Tax: xxx
10 Abstract class Vehicle not modified. The provided one will be used when grading.
4 Both Car.cpp and Car.h compile and produce correct output.
4 Both Truck.cpp and Truck.h compile and produce correct output.
4 Both Tanker.cpp and Tanker.h compile and produce correct output.
4 Output in the same format as above. One line per vehicle.
4 No inline functions (-4 if any is present. -4 points if any .h or .cpp file is missing or empty).
Zip your files before submitting. Check that all your files are in the zip archive -4 if any is missing that you need to re-submit after the test is over.