Create a cass RealEstate with the following details Member variables: ouildingD buildingName Member Methods: // building D string type // name of the building string type Parameterized constructor to set the member variables. rentPrice): An abstract method which calculates and retum the rent Defined in a subciass. display0: To display the name & D of the building Create a class Apartment that inherits RealEstate with the following Member variables: noOfrooms noOfsatnroom furnished Member Methods: Define the parameterized constructor to set the member variables and also call the constructor of the superclass Define the method rentPrice which calculate and return the rent as given below Condition I/ number of rooms int type 1 number of bath rooms int type I/ To check whether the furnished or not Boolean type Rent price in OMR noORooms-2 noOfBathrooms2 and furnished=yes hoORooms-2noofBathrooms 2200 and furnishedeNo noOfRooms 3,noOfBathrooms=3350 and furnishedyes 250 noORooms=1,noofBathrooms=2150 and furnishedNo Otherwise 175 Define the metnod aisplayo whicn display all cetals including rent of the apartment 3. Create a Driver cass to execute the a0ove class construction with the following detals: Create an object of Apartment ciass Use given sample inout for your construction: Apartment"b123 Al-Kimyani" 3,3, true); Display al details.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
1. Create a class RealEstate with the following details: Member variables: buildingID // building ID string type buildingName // name of the building string type Member Methods: · Parameterized constructor to set the member variables. · rentPrice(): An abstract method which calculates and return the rent. Defined in a subclass. · display(): To display the name & ID of the building. 2. Create a class Apartment that inherits RealEstate with the following details: Member variables: · noOfrooms // number of rooms int type · noOfBathroom // number of bath rooms int type · furnished // To check whether the furnished or not Boolean type Member Methods: · Define the parameterized constructor to set the member variables and also call the constructor of the superclass · Define the method rentPrice() which calculate and return the rent as given below: Condition Rent price in OMR noOfRooms=2 ,noOfBathrooms=2 and furnished=yes 250 noOfRooms=2,noOfBathrooms=2 and furnished=No 200 noOfRooms=3,noOfBathrooms=3 and furnished=yes 350 noOfRooms=1,noOfBathrooms=2 and furnished=No 150 Otherwise 175 Define the method display() which display all details including rent of the apartment 3. Create a Driver class to execute the above class construction with the following details: · Create an object of Apartment class. Use given sample input for your construction: Apartment("b123","Al-Kimyani",3,3, true); · Display all details.
1.
Member variables:
Create a class RealEstate with the following details:
buildingID
buildingName
Member Methods:
// building ID string type
// name of the building string type
Parameterized constructor to set the member variables.
rentPrice): An abstract method which calculates and retun the rent Defined in a subclass.
display): To display the name & ID of the building
2.
Create a class Apartment that inherits RealEstate with the following details:
Member variables:
noofrooms
noOfBathroom
furnished
Member Methods:
// number of rooms int type
I/ number of bath rooms int type
// To check whether the furnished or not Boolean type
Define the parameterized constructor to set the member variables and also call the constructor of the superclass
Define the method rentPrice) which calculate and return the rent as given below:
Condition
Rent price in OMR
noOfRooms=2
noOfBathrooms-2 and
furnished=yes
250
noOfRooms 2,noOfBathrooms 2200
and furnished=NO
noORooms=3,noOfBathrooms=3350
and furnished yes
noOfRooms=1,noOfBathrooms=2150
and furnishedNo
Otherwise
175
Define the method display) which display all detalls including rent of the apartment
3.
Create a Driver class to execute the above class construction with the following detals:
Create an object of Apartment cass. Use given sample inout for your construction:
Apartment("b123"Al-Kimyani"3,3, true);
Display all details.
Transcribed Image Text:1. Member variables: Create a class RealEstate with the following details: buildingID buildingName Member Methods: // building ID string type // name of the building string type Parameterized constructor to set the member variables. rentPrice): An abstract method which calculates and retun the rent Defined in a subclass. display): To display the name & ID of the building 2. Create a class Apartment that inherits RealEstate with the following details: Member variables: noofrooms noOfBathroom furnished Member Methods: // number of rooms int type I/ number of bath rooms int type // To check whether the furnished or not Boolean type Define the parameterized constructor to set the member variables and also call the constructor of the superclass Define the method rentPrice) which calculate and return the rent as given below: Condition Rent price in OMR noOfRooms=2 noOfBathrooms-2 and furnished=yes 250 noOfRooms 2,noOfBathrooms 2200 and furnished=NO noORooms=3,noOfBathrooms=3350 and furnished yes noOfRooms=1,noOfBathrooms=2150 and furnishedNo Otherwise 175 Define the method display) which display all detalls including rent of the apartment 3. Create a Driver class to execute the above class construction with the following detals: Create an object of Apartment cass. Use given sample inout for your construction: Apartment("b123"Al-Kimyani"3,3, true); Display all details.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education