Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In C++ console program Create a class named Vehicle. The class has the following

ID: 3815110 • Letter: I

Question

In C++ console program

Create a class named Vehicle. The class has the following five member variables:

• Vehicle Name

• Vehicle number

• Sale Tax

• Unit price

• Total price

Include set (mutator) and get (accessor) functions for each field except the total price field. The set function prompt the user for values for each field. This class also needs a function named computePrice() to compute the total price (quantity times unit price + salesTax) and a function to display the field values. [Note: Sale tax is 10%, sale tax = Unit price * saleTax)

Create a subclass named VehicleOrder that overrides computePrice() function by adding a shipping and handling charge of $12.00.

Write an application named UseVehicle that instantiates an object of each of these classes.

Prompt the user for data for the Vehicle object, and display the results, then prompt the user for data for the VehicleOrder object, and display the results.

Explanation / Answer

#include <iostream>
#include <string>
using namespace std;
void accelerate()
{
int speed;
speed = speed + 8;
}
class car
{
public:
car(int getYear, string getMake);
void accelerate();
void brake();
private:
int year;
string make;
int speed;
};
void brake()
{
int speed;
speed = speed - 8;
}