Closed

Need Help (Homework Assignment)

This project received 38 bids from talented freelancers with an average bid price of $24 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$30 - $50 USD
Total Bids
38
Project Description

Please produce a program according to the instructions given. Who ever does this will be paid well. Thank you. I need this before Monday (November 6th or early November 7th)


## Deliverables

Imagine a sequence of rooms / apartments in a hallway. Each room has several attributes: name of tenant, rent cost, pollution level, and noise level. Write a program that allows one to determine the level of noise and pollution in a given room that is due to a combination of the room tenant’s own behavior and the neighbors several rooms to the left and right.

Use the following data for running the programs:













































































































| Room# | Tenant name | Rent | Pollution | Noise |
| 21 | Jack | 500 | 80 | 20 |
| 22 | Jane | 450 | 10 | 10 |
| 23 | John | 600 | 5 | 50 |
| 24 | Spot | 200 | 100 | 100 |
| 25 | Apple | 150 | 1 | 1 |
| 26 | Bill | 520 | 30 | 25 |
| 27 | George | 480 | 40 | 5 |
| 28 | Steve | 800 | 70 | 55 |
| 29 | Anne | 750 | 10 | 10 |
| 30 | Meow | 450 | 90 | 10 |

Your program should read the room number that you want to check and the number of rooms that form the radius of the neighborhood for doing the test. For example, if you specify room number 5 (Apple) and neighborhood radius one, you need to sum up the pollution and noise level of room numbers 4, 5, and 6. If you specify room number 2 (Jane) and neighborhood size three, you need to sum up the properties of room numbers 1, 2, 3, 4, and 5.

Here’s an example run:

Neighborhood Tester

===================

Tenants:

Jack, Jane, John, Spot, Apple, Bill, George, Steve, Anne, Meow

Enter room number to test: 25

Enter neighborhood radius: 1

Tenant: Apple

Rent: 150

Pollution level: 1

Noise level: 1

Neighbors: Spot, Bill

Neighborhood pollution level: 131

Neighborhood noise level: 126

Here’s another example run:

Neighborhood Tester

===================

Tenants:

Jack, Jane, John, Spot, Apple, Bill, George, Steve, Anne, Meow

Enter room number to test: 22

Enter neighborhood radius: 2

Tenant: Jane

Rent: 450

Pollution level: 10

Noise level: 10

Neighbors: Jack, John, Spot

Neighborhood pollution level: 195

Neighborhood noise level: 180

Implement the program by using arrays of objects. Each object is of type ApartmentRoom. The class ApartmentRoom contains the following data: tenant name, rent cost, pollution level, and noise level. Each of the data is private.

The class ApartmentRoom has the following operations: member access functions (setTenantName, getTenantName, setRent, getRent, setPollutionLevel, getPollutionLevel, setNoiseLevel, getNoiseLevel) and a print method. The print method should display the tenant name, rent, followed by the pollution and noise levels. Example for the “Apple?? tenant:

Tenant: Apple

Rent: 150

Pollution level: 1

Noise level: 1

You should make sure that the user input makes sense. If the room number is not one of the ones listed in the data above then display an error message. If the size of neighborhood is negative you should also display an error message.

You’ll need to write two classes. Name the class representing the room as ApartmentRoom and name the class with main method Program04. Submit the files [url removed, login to view] and Program04.java. Submit one of the files first following the usual submission step and then don’t forget to click “Add Another File...?? to add your second file.


## Platform

Java (JGrasp)

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online