Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started