Question
Comments are required. Include screenshot of your work A Real Estate Agency needs Management System that records the details about their offers: houses and apartments
- Comments are required.
- Include screenshot of your work
A Real Estate Agency needs Management System that records the details about their offers: houses and apartments In this project, you will be using object-oriented programming concepts and design in total four classes:
In this assignment 3, you will implement two classes named Residence and Address In the next assignment, you will design two other classes: House, and Apartment.
The following diagram shows the relationships between these classes you are required to implement.
|
In this assignment, you will implement Address and Residence classes. The Residence class is the parent class of apartment and House classes.
Consider the following UML class diagram: Create a new C# project.
Q 1 : A : Implementation details of Address class:
Add and implement a class named Address according to specifications in the UML class diagram.
- Data fields (private): street, city, province and zipCode.
- Properties: Street, City, Province and ZipCode
- Constructors:: A no-arg constructor that creates a default Address.
- A constructor that creates an address with the specified street, city, state, and zipCode
- ToString() to print out all available information about the current object
B: A test program for the Address class
To demonstrates the Address class, in main method write a program that:
- Prompts the user to enter the street name
- Prompts the user to enter city name
- Prompts the user to enter the province name
- Prompts the user to enter the zip code
- Creates an instance called testAddress of type Address with the entered data
- Displays this information using ToString().
Example of data:
- Street: 265 Yorkland Blvd.
- City: Toronto
- State: Ontario
- zipCode: M2J 1S5
- Question 2 :
- Implementation details of Residence class:
Add and implement a class named Residence according the instruction in the UML diagram
- Data fields: bedrooms, bathrooms, price, squareFeet, yearBuilt and address.
- Properties: Bedrooms, Bathrooms, Price, SquareFeet, YearBuilt and Address
- Constructors:
- A no-arg constructor that creates a default Residence.
- A constructor that creates a Residence with the specified bedrooms, bathrooms, price, squareFeet, yearBuilt and address.
- CalculateCommission() that returns the commission amount. The commission rate is set up at 2%.
- ToString() that returns the information about the current object( bedrooms, bathrooms, etc.).
- A test program for the Residence class
In main method, you already created an instance of Address class called testAddress and prompted the user to enter the address details.
- Now prompt the user to enter the numbers of bedrooms and bathrooms, price, square Feet and year built.
- Create an instance of the residence class with the entered data (including the address data).
- Display the information about the residence using ToString().
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started