Solved by verified expert:Complete a program that has a user enter a pollutant choice, a number of grams of the pollutant emit
p9.pdf

Unformatted Attachment Preview

Specification
Complete a program that has a user enter a pollutant choice, a number of grams of the
pollutant emitted per mile, and an odometer reading (0-100000).
Output an indication of whether or not they are compliant with the following regulations:
first 50,000 miles second 50,000 miles
carbon monoxide
3.4 grams/mile
4.2 grams/mile
hydrocarbons
0.31 grams/mile
0.39 grams/mile
nitrogen oxides
0.4 grams/mile
0.5 grams/mile
non-methane hydrocarbons 0.25 grams/mile
A sample run is shown here:
0.31 grams/mile
Your program must
1. Not change any of the given code.
2. Use the defined constant variables for any constant values in your program.
3. Create additional constant variables to use when checking the mileage
boundaries (50000 miles and 100000 miles).
4. Output an indication that an invalid odometer reading has been entered (outside
of the range of 0-100000).
5. Use the switch statement started in the program for your decision structure.
6. Have at least one other user defined function. One possibility is the following
function that determines the allowable level for a particular pollutant:
double getAllowableLevel (double gramsPerMileAllowed1, double
gramsPerMileAllowed2, int odometer);

Purchase answer to see full
attachment