java programming 61

Instructions:


Step 1

Modify the Room class by adding the following methods:

Method 1: hasAdequateCooling

The purpose of this method is to check the room’s air conditioner to see if it has a high enough cooling capacity to adequately cool the 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. If that room has an air conditioner with a cooling capacity of 8,000 BTUs per Hour, then that room does not have adequate cooling.

The method should not accept any arguments, and should return true if the room has adequate cooling, and false if the room does not.

Method 2: toString

Use this method to display all of the relevant information of the Room class (including it’s AirConditioner)

Step 2

Minimize the risk of security holes in your program (Note: review the “Security Issues with Aggregate Classes” section in Chapter 8).

Step 4

Modify the demonstration program from Project 2 to have it process the Rooms2.txt file (IMPORTANT: This is a different file from Project 2). This file contains information about rooms, and the air conditioning unit contained in those rooms. The text file contains information in the following order:

    • 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)
    • Air Conditioner Manufacturer
    • Air Conditioner Type (can be Window Mounted or Portable)
    • Air Conditioner Cooling Capacity (measured in BTUs per Hour)

The program should create Room and AirConditioner objects (using the constructor that accepts arguments) for each of the rooms contained in the file.

The code should be able to handle a file of any size.

The demo program should store the Room objects in a structure that can automatically adjust to accommodate the number of objects being stored in it. (Hint: Review Chapter 7).

Step 5

Sometimes as you progress on a project in a work environment, your requirements can change and you must remove or alter existing code (even if it is fully functional). To simulate this, the previous information from Project 2 regarding the number of rooms with each type of shade should NOT be displayed. You can remove that part of the code that was left in Project 2.

Step 6

The demo program should output the information like the sample output provided below (this includes the formatting of the numbers).

Sample output

Room Name: Master Bathroom

Room Area (in square feet): 155.0

Amount of Shade: Abundant

BTUs Per Hour needed: 4,950

Air Conditioner Manufacturer: GE

Air Conditioner Type: Portable

Air Conditioner Cooling Capacity (BTUs Per Hour): 8,000

This room is adequately cooled.

Room Name: Master Bedroom

Room Area (in square feet): 260.0

Amount of Shade: Moderate

BTUs Per Hour needed: 10,000

Air Conditioner Manufacturer: Frigidaire

Air Conditioner Type: Portable

Air Conditioner Cooling Capacity (BTUs Per Hour): 8,000

This room is not adequately cooled.

Room Name: Living Room

Room Area (in square feet): 750.0

Amount of Shade: Little

BTUs Per Hour needed: 20,125

Air Conditioner Manufacturer: Whirlpool

Air Conditioner Type: Window Mounted

Air Conditioner Cooling Capacity (BTUs Per Hour): 18,000

This room is not adequately cooled.

Room Name: Kitchen

Room Area (in square feet): 240.0

Amount of Shade: Moderate

BTUs Per Hour needed: 5,500

Air Conditioner Manufacturer: GE

Air Conditioner Type: Window Mounted

Air Conditioner Cooling Capacity (BTUs Per Hour): 6,000

This room is adequately cooled.

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.