Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class named CarRental that contains the following fields: renterName, zipCode, carSize, rentalFee, numDaysRented, and totalRentalFee. The class contains a constructor that requires all
Create a class named CarRental that contains the following fields: renterName, zipCode, carSize, rentalFee, numDaysRented, and totalRentalFee. The class contains a constructor that requires all of the rental data except total fee, which is calculated based on the size of the car: economy at $29.99 per day, midsize at $38.99 per day, or full size at $43.50 per day. The class also includes a display() method that display all of the rental data. Create a subclass named LuxuryCarRental. This class sets the rental fee at $79.99 per day. Write an application named UseCarRental that prompts the user for the renter's name, zip code, the size of the car to rent, and the number of days they want to rent it. Your application should display the total rental fee.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started