1
answer
1
watching
175
views

JAVA Coding Needed

6-Your program MUST be very modular

7-Your output MUST friendly (using labels for all info accordingly) and do display all input and calculated fields.

8-You must implement JOptionPane for all your input and output and must validate all input for all prompts.

 

Problem’s specifications:

 The GPMS (Green Pollution Monitoring Service ) a fictitious orgaism is tasking you with the coding of an application that monitors the pollution levels of different sites in the USA.

All data are to be stored in an array of 100 object of type ‘Site’

Code a class ‘Site’ with the following attributes and methods:

-the ID of a given site.

-The name of a given site

-the pollution numeric value: adopt data and attributes from the following site

-Index value (see below under option 2 in the menu)

 

What to do?

-In the main class, declarae an array of 100 object of type ‘Site’

-In the main class, code the following menu in a separate function:

MENU

---------

-1-Add a site

-2-Display a site

-3-Quit

-If user select 1 from the MENU, constract an object site, and call a method in the class ‘Site’ that input data for a given site.

-If user select 2 from the MENU, call a function that search for a site in the array of objects of type ‘Site’  by ID and if found call a function that determines the index value (1 for good, 2 for moderate, 3 for unhealthy for sensitive groups, 4 for unhealthy, 5 for very unhealthy, 6 for hazardous)  based on the pollution numerical value as represented in the given site.

-Call a function member of the class Site, that displays a report about this site (ID, Name, Pollution Value, Index Statement based on the index numerical value)

-Code a function/routine that after the user complete the input of all available sites, displays the site info. that is the most polluted. Also, display how many sites were input for this study.

What to submit?

Submit your complete .Java code named HW3_lastname.java

Extra credits:

-Use ArrayList instead of array of objects

For unlimited access to Homework Help, a Homework+ subscription is required.

Avatar image
Read by 1 person

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in

Related questions

Related Documents

Weekly leaderboard

Start filling in the gaps now
Log in