Question: WRITE A PROGRAM Project Name: Air Conditioning Project Filename: Room.java Project1_ _ .java (This is the demo class) Only jGrasp should be used to code

WRITE A PROGRAM

Project Name:

Air Conditioning

Project Filename:

Room.java

Project1__.java (This is the demo class)

Only jGrasp should be used to code the project.

In some older homes that do not have a central heating and air conditioning system, smaller air conditioning units made to cool a single room are used as an alternative way to cool the home.

Depending on the size of the room and the amount of shade that the room has, different sizes of air conditioning units must be used in order to be able to properly cool the room. The unit of measure for the amount of cooling that an air conditioner unit can provide is the BTU (British Thermal Unit) per hour.

Create a Room class that will model a room that needs to be cooled by an Air Conditioning Unit. A Room has the following items of interest:

Name (example: Master Bedroom)

Room Length (in feet)

Room Width (in feet)

Amount of shade that the room gets (can be Little, Moderate, or Abundant)

Required Cooling Capacity (Hint: this is a calculated amount based on the attributes above - make sure to avoid having a stale value for this. See "Avoiding Stale Data" in Section 6.2)

Use the following guidelines to create the Room class:

Include appropriate fields (Hint: See the list of important Air Conditioner attributes above)

Include a no-arg constructor and a constructor that accepts arguments (it must accept all necessary arguments to fully initialize the Room object).

Include appropriate setters and getters (i.e., mutator and accessor methods) for each field.

Include a method that accepts no arguments and will calculate and return the area of the room.

Include a method that accepts no arguments and will calculate and return the cooling capacity needed to properly cool the room.

You can determine the capacity of the air conditioning unit that is needed for a moderately shaded room by using the information in the table below.

Room Size (Square Feet)

Air Conditioner Capacity (in BTUs per Hour)

Under 250

5,500

From 250 to 500

10,000

Over 500 to Under 1000

17,500

1000 or Greater

24,000

If the room has little shade, then the BTU capacity should be increased by 15% since the air conditioning unit must be able to produce extra cooling.

If the room has abundant shade, then the BTU capacity should be decreased by 10% since the air conditioning unit does not need to work as hard to cool a shaded room.

For example, a Moderately Shaded room that is 500 square feet requires an air conditioner with a capacity of 10,000 BTUs per Hour. That same room would require 11,500 BTUs per Hour (10,000 * 1.15) if it was a lightly shaded room, or 9,000 BTUs per Hour (10,000 * 0.9) if it was a heavily shaded room.

All data in the Room class should be encapsulated

Demonstrate your Room class by creating a Demo Class that creates a single instance of the Room class using the constructor that accepts arguments. Use the methods of the Room object that you create to display the output as show in the Sample Output. When outputting the area, round to a single decimal place.

Sample Input:

Please enter the name of the room: Guest Bedroom

Please enter the length of the room (in feet): 14.5

Please enter the width of the room (in feet): 10

What is the amount of shade that this room receives?

Little Shade

Moderate Shade

Abundant Shade

Please select from the options above: 3

Sample Output:

Room Name: Guest Bedroom

Room Area (in square feet): 145.0

Amount of Shade: Abundant

BTUs Per Hour needed: 4,950

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!