Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ QUESTION House Question: Suppose you are hired to develop a program for a rental house agent. The system is used to advertise all houses

C++ QUESTION

image text in transcribed

image text in transcribed

image text in transcribed

House Question: Suppose you are hired to develop a program for a rental house agent. The system is used to advertise all houses for rent. The rental houses include two types of houses: bungalow and apartment houses. Location -street: string -no Room : int; -town: string #rentRate : double +Location (string" ", string "") +House() + getStreet(): string + House(Location, int, double) + getTown(): string + getLocation():string +getFullLocation(): string + getRoom():int + getRate(): double + getDeposit(): virtual double + display(): virtual void Bungalow -land : int +Bungalow + Bungalow(Location, int, double, int) +getLand():int + getDeposit(): double + display() : void Apartment -level:int +Apartment() +Apartment(Location, int, double, int) +getFLevel():int + getDeposit(): double + display:void Figure 1. UML Class Diagram 1. Given the class diagram in Figure 1, write C++ program based on the diagram. Note that, the purpose of each operation is as its name implies. Define class Location, class House, class Bungalow and class Apartment with attributes and methods as shown in the class diagram. Class House has pure virtual function, namely getDeposit() and display(). The deposit for Bungalow is 6 months rent amount while the deposit for Apartment is 3 months rent amount. The information for Apartment and Bungalow to be displayed in display() function are as shown in Figure 2. 2. Define main() program with the following implementation: Define one Bungalow instance with values as shown in the output in Figure 2. Define two Apartment instances with values as shown in the output in Figure 2. Display the information of all the houses for rent as shown in the Figure 2. *** HOUSE FOR RENT *** We have a bungalow located at Eco Botanic , Nusajaya with 6 bedrooms Land size : 1200 sqft. Monthly rental rate: RM2400.00 Deposit : RM14400.00 We have an apartment located at Meridin, Medini with 3 bedrooms, at level 5. Monthly rental rate: RM1000.00 Deposit : RM3000.00 We have an apartment located at Meridin, Medini with 2 bedrooms, at level 2. Monthly rental rate: RM700.00 Deposit : RM2100.00 Figure 2. Expected Output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

5 Explain how to plan informational reports and website content

Answered: 1 week ago