Search the whole station

c++作业代写 CISC_2000代写 Final Lab代写 code代写

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.

c++作业代写
c++作业代写

The provided abstract class Vehicle has one protected string variable vin.

#ifndef VEHICLE_H
#define VEHICLE_H
#include <string>
class Vehicle
{
protected:
std::string vin;
public:
Vehicle();
Vehicle(std::string newVin);
virtual void print() = 0;
};
#endif // VEHICLE_H_INCLUDED

Three additional classes are used to represent the different types of vehicles and are described below.

Car c++作业代写

Has member variable:

protected:
int age;

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”.

Truck

Has member variables:

protected:
int weight;
double taxRate2000;
double taxRateOver2000;

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:

Car car_1("CAR1_3123123123",2);
Car car_2("CAR2_1231231234",4);
Truck truck_1("TRK1_3123123123",2000);
Truck truck_2("TRK2_4567890123",2100);
TankTruck tanktruck_1("TNKTRK1_31234567",2000);
TankTruck tanktruck_2("TNKTRK2_3456789", 2100);
truck_1.setTaxRate(0.10,0.15);
tanktruck_1.setTaxRate(0.10,0.15);

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

Points c++作业代写

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.

更多代写:温哥华Java quiz代考  多邻国线上考试  英国物理代上网课推荐  文科作业代写英国  北美文学分析  turnitin查重降重

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

The prev: The next:

Related recommendations

1
您有新消息,点击联系!