Question: 1-a Date class in Java having day, month and year data members. constructors for initializing data members, functions for validating date, getting values of data
1-a Date class in Java having day, month and year data members. constructors for initializing data members, functions for validating date, getting values of data members and displaying the date -
.2- a class named HotelRoom that includes an integer field for the room number and a double field for the nightly rental rate. The constructor of this class requires an integer argument representing the room number and the constructor sets the room rate based on the room number; rooms numbered 299 and below are $69.95 per night, and others are $89.95 per night. an extended class named Suite whose constructor requires a room number and adds a $40 surcharge to the regular hotel room rate, which again is based on the room number. an application named UseHotelRoom that an object of each class, accept room number from user, demonstrate that all the methods work correctly and display the detail
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
