Question: 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
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
Output an indication of whether or not they are compliant with the following regulations:
first miles second miles
carbon monoxide gramsmile gramsmile
hydrocarbons gramsmile gramsmile
nitrogen oxides gramsmile gramsmile
nonmethane hydrocarbons gramsmile gramsmile
A sample run is shown here:
Your program must
Not change any of the given code.
Use the defined constant variables for any constant values in your program.
Create additional constant variables to use when checking the mileage
boundaries miles and miles
Output an indication that an invalid odometer reading has been entered outside
of the range of
Use the switch statement started in the program for your decision structure.
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 gramsPerMileAllowed double
gramsPerMileAllowed int odometer;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
