Question: Write a program in Java which computes the level of pollution for different gases. The program displays a menu and receive data from a user.

Write a program in Java which computes the level of pollution for different gases. The program displays a menu and receive data from a user. The pollution level is checked for newer and older cars.

Menu:

1.Carbon monoxide

2.Hydro Carbons

3. nitrogen oxides

4.Non methane hydro carbons

Inputs will be pollutant number in grams released per miles and the odometer reading

Output : passed or failed and display why it failed.

For cars lower than 50,000 miles

The accepted levels are:

  1. 3.4 or less
  2. 0.3 or less
  3. 0.4 or less
  4. 0.25 or less

For cars with 50,000 or more:

1* 4.2 or less

2 * 0.39 or less

3* 0.4 or less

4* 0.31 or less

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!