Question: Please I need help with this again. I already started the program you can just copy a paste it, now I just need to complete
Please I need help with this again. I already started the program you can just copy a paste it, now I just need to complete it. I am using xcode lite and writing in C++ program. Thank you.
Here is the starting program:
#include
#include
const int CARBON_MONOXIDE = 1;
const int HYDROCARBON = 2;
const int NITROGEN_OXIDE = 3;
const int NONMETHANE_HYDROCARBON = 4;
const int QUIT = 0;
const double CARBON_MONOXIDE_ALLOWED1 = 3.4;
const double CARBON_MONOXIDE_ALLOWED2 = 4.2;
const double HYDROCARBON_ALLOWED1 = 0.31;
const double HYDROCARBON_ALLOWED2 = 0.39;
const double NITROGEN_OXIDE_ALLOWED1 = 0.4;
const double NITROGEN_OXIDE_ALLOWED2 = 0.5;
const double NONMETHANE_HYDROCARBON_ALLOWED1 = 0.25;
const double NONMETHANE_HYDROCARBON_ALLOWED2 = 0.31;
using namespace std;
void outputMenu();
int main(int argc, char *argv[])
{
int pollutant;
int odometer;
double gramsPerMile;
outputMenu();
cin >> pollutant;
while (pollutant != QUIT)
{
cout
cout
cin >> gramsPerMile;
cout
cin >> odometer;
switch (pollutant)
{
case CARBON_MONOXIDE:
break;
case HYDROCARBON:
break;
case NITROGEN_OXIDE:
break;
case NONMETHANE_HYDROCARBON:
break;
}
outputMenu();
cin >> pollutant;
}
cin.ignore();
cin.get();
}
void outputMenu()
{
cout
cout
cout
cout
cout
cout
cout
}


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 0.31 grams/mile 0.39 grams/mile hydrocarbons 0.4 grams/mile 0.5 grams/mile nitrogen oxides non-methane hydrocarbons 0.25 grams/mile 0.31 grams/mile A sample run is shown here: (1 Carbon monoxide (2 Hydrocarbons X3 Nitrogen oxides (4 Non-nethane hydrocarbons CO> Quit Enter choice: 1 Enter grans en itted per mile: 3.2 Enter odometer reading 77000 Enissions within allowable level of 4.2 grans nile X1 Carbon monoxide (2 Hydrocarbons X3 Nitrogen oxides C4> Non methane hydrocarbons CO> Quit Enter choice: 2 Enter grans enitted per mile .25 Enter odometer reading 23456 sions within allowable level of 0.31 grams nile X1 arbon monoxide Hydrocarbons X3 oxides K4> Non-nethane hydrocarbons CO> Quit Enter choice: 3 Enter grans enitted per mile Enter odometer reading 100100 Mileage 100100 must be within 0-100000 miles (1 arbon monoxide X2 Hydrocarbons C3> Nitrogen oxides K4> Non-methane hydrocarbons Quit Enter choice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
