Using C++ to create the following: 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.
Using C++ to create the following:
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.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images