Question: Create a class named Vehicle . The class has the following five member variables: Vehicle Name Vehicle number Sale Tax Unit price Total price Include

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!