Create a class named CarRental that contains field's for: renter's name, zip code,size of car, daily rental fee, length of rental (in days), and total rental fee. The class should include a constructor that requires all the rental data except the daily rate and total fee, which are calculated based on the size of the car: economy size ($ 29.99 per day), midsize ($ 38.99), and full size ($ 43.50). The class also includes a display() method that will display all the rental information. Create a subclass name LuxuryCarRental. This class sets the rental fee at $79.99 per day and prompts the user to respond to the option of including a chauffeur at an addition $200 per day. Override the parent class display() method to include chauffeur fee information. Write an application named UseCarRental that prompts the user for the data needed for a rental and creates an object of the correct type. Display the total rental fee.
Create a class named CarRental that contains field's for:
renter's name, zip code,size of car, daily rental fee, length of rental (in days), and total rental fee.
The class should include a constructor that requires all the rental data except the daily rate and total fee, which are calculated based on the size of the car:
economy size ($ 29.99 per day), midsize ($ 38.99), and full size ($ 43.50).
The class also includes a display() method that will display all the rental information.
Create a subclass name LuxuryCarRental. This class sets the rental fee at $79.99 per day and prompts the user to respond to the option of including a chauffeur at an addition $200 per day. Override the parent class display() method to include chauffeur fee information.
Write an application named UseCarRental that prompts the user for the data needed for a rental and creates an object of the correct type. Display the total rental fee.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images