Question
Every summer, Leeland Lakeside resort rents cabins by the week. Create a class named CabinRental that includes an integer field for the cabin number and
Every summer, Leeland Lakeside resort rents cabins by the week. Create a class named CabinRental that includes an integer field for the cabin number and a double field for the weekly rental rate. Include get methods for these fields and a constructor that requires an integer argument representing the cabin number. The constructor sets the weekly rate based on the cabin number; cabins numbered 1, 2, and 3 are $950 per week, and others are $1,100 per week. Create an extended class named HolidayCabinRental that is used for rentals during weeks that include summer holiday weekends. The constructor for this class requires a room number and adds a $150 surcharge to the regular rental rate. Write an application named DemoCabinRental that creates an object of each class, and demonstrate that all the methods work correctly.
Step by Step Solution
3.38 Rating (157 Votes )
There are 3 Steps involved in it
Step: 1
class CabinRental int cabinnum double weeklyrental CabinRentalint cabinnum thiscabinnum cabinnum Ass...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