Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

  1. Prompts the user to enter the street name
  2. Prompts the user to enter city name
  3. Prompts the user to enter the province name
  4. Prompts the user to enter the zip code
  5. Creates an instance called testAddress of type Address with the entered data
  6. Displays this information using ToString().

Example of data:

  • Street: 265 Yorkland Blvd.
  • City: Toronto
  • State: Ontario
  • zipCode: M2J 1S5
  • Question 2 :
  1. 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.).
  1. 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.

  1. Now prompt the user to enter the numbers of bedrooms and bathrooms, price, square Feet and year built.
  2. Create an instance of the residence class with the entered data (including the address data).
  3. Display the information about the residence using ToString().

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

What are monitoring controls?

Answered: 1 week ago