4. Write an named carRental that contains fields that holds a renters name, zip code, size of the car tented, daily rent

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

4. Write an named carRental that contains fields that holds a renters name, zip code, size of the car tented, daily rent

Post by answerhappygod »

4. Write an named carRental that contains fields that holds a renters name, zip code, size of the car tented, daily rental fee, length of rental in days, and total rental fee. The class contains 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 at $29.99 per day, midsize at $38.99 per day, or full size at $43.50 day. The claw also includes a display() method that displays all the rental data. Create a subclass named LuxuryCarRental. This class sets the rental fee at $79.99 day and prompts the user to respond to the option of including a chauffeur at $200 more day. Override the parent class display() method to include chauffeur fee information. Write an application named UseCarRental that prompts the user the data needed for a rental and creates an object of the correct type. Display the total rental fee. Save the files as CarRental.java, LuxuryCarRental.java, and UseCarRental.java.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply