Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# Programming The following Homework assignment has you creating the Main class, the House class and the Room class. In the main, you will create

C# Programming

The following Homework assignment has you creating the Main class, the House class and the Room class. In the main, you will create and work with a House object. The house object has a few rooms in it as objects. The rooms have a Length, Width, and a TV variable which is true or false if there is a TV in that room.

*Make sure each class is in its own file with the correct Methods, constructors and data types*

**This assignment does not use Inheritance**

The Room class has the following private variables:

double width;

double length;

bool TV;

The constructor of the Room class should assign random values for all 3 variables. The range for the width and length is 10-25.

The House class has the following private variables:

Room topRooms[];

Room bottomRooms[];

The constructors for the House class will ask the user how many rooms are on the top floor and how many are on the bottom floor. In the case of the overloaded constructor, the total number of rooms comes from the main while on the default constructor you should ask the user. Make sure the number of rooms on bottom and on top add up to the total number of rooms..if not, you should have them re-enter these values. Make sure you create the actual rooms at this point by using the Rooms default constructor.

In the main, you should ask first for the number of rooms in the house (1-6 rooms only). Create the house object at this point, passing the variable to the overloaded constructor for house which accepts this variable as the only parameter.

Display all top floor Room dimensions and Areas along with if a TV is in that room. Display all bottom floor Room dimensions and Areas along with if a TV is in that room.

Your program should ask the user for preferred location of room, top or bottom floor. Display to the user the room with the largest area in that floor.

Finally, display how many TVs are in the house and display this number.

* I did not specify which Methods or Properties to use, so you should define all the properties you can and methods to access the data required. A good portion of your grade is to ensure these are written and used correctly. *

When you are done, compress the folder and attach it. *Right click folder, Send To, Compressed (zipped) folder*

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_2

Step: 3

blur-text-image_3

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

Explain how the (OTP) one-time password approach works.

Answered: 1 week ago

Question

How are the activities of permanent funds controlled?

Answered: 1 week ago