Write an application-demonstrates all methods work correctly


Discuss the below:

Q1: Creat a class named HotelRoom that includes an interger field for the room number and a double field for the nightly rental rate. Include get methods for these fields and constructor that requires an interger argument representing the room number. The constructor set s the room rate based on the room number; roooms numbered 299 and below are $69.95 per night, and others are $89.95 per night. SAve as HotelRoom.java

Q2: Create and extened class named Suite whose constructor requires a room number and adds a $40 surcharge to the regular hotel room rated, which is based on the room number. Sace as Suite.java

Q3: Write an application named Use HotelRoom that creates an object of each class, and demonstrates all the methods work correctly. Save as UseHotelRoom.java

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write an application-demonstrates all methods work correctly
Reference No:- TGS01934575

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)