Computer Science, asked by annonymous0911, 7 months ago

Maple Suites is a serviced apartments rental System which offers Apartments that are spacious and modern, the apartments vary from deluxe, single and double rooms. A Single room measures 10 feet in length and breadth and costs Rs. 600. A Double room measures 15 feet in length and breadth and costs Rs. 1000. A Deluxe room measures 20 feet in length and breadth and costs Rs. 1500. Room Rent is calculated using, Rent = cost*number of persons accomodating*number of days of accomodation. Size of a room is calculated using, Size = length*breadth. The total amount will been differ by the additional preferences. In Singe room, there are two category they are, AC - The tax for AC room is 8.9% Non-AC - The tax for Non-AC is 5.8% In Double room, there are two category they are, Extra Cot - The tax for this category is 6.4% Ordinary - The tax for this category is 3.5% In Deluxe room, there also has two category they are, Complementary breakfast - The tax for this category is 7.3% Ordinary - The tax for this category is 4.9% Write a program using the concept of abstract class and abstract methods, to find the room rent based on the number of persons accomodating and number of days of accomodation and the size of the room. Problem Specifications: [Note: Strictly adhere to the object oriented specifications given as part of the problem statement. Use the same class names and member variable names.] Create an abstract class called Room with the following members Double cost Integer length Integer breadth Include the following abstract methods in Room class S. no Method name Method description 1 public abstract Double calculateTotalCost(int noOfPersons, int noOfDays) This method is used to calculate the rent and return the value 2 public Integer calculateArea() This method is used to calculate area and return the value. Create a class called SingleRoom which extends class Room Create a three argument constructor with attribute (cost,length,breadth) Override the parent class methods in this class Write appropriate getters & setters for all the members Create a class called DoubleRoom which extends class Room Create a three argument constructor with attribute (cost,length,breadth) Override the parent class methods in this class Write appropriate getters & setters for all the members Create a class called DeluxeRoom which extends class Room Create a three argument constructor with attribute (cost,length,breadth) Override the parent class methods in this class Write appropriate getters & setters for all the members Create a driver class named Main which creates an instance of the above mentioned classes. Use setters to set the values to objects and display all details using getters from the main method.

Answers

Answered by amru12
0

I don't have to worry too long about this question but I'm not going anywhere to draw the attention to draw on mental health and a little bit of the common experience of being a avatoon store owner who has been in a position to draw a

Similar questions