|
|
Permission = "exceeds ";
if (Emission / Miles < Standard || Emission / Miles == Standard)
if (Emission / Miles <= Standard)
Emission
to be a double
, it won't make any difference here, it just saves the compiler an implicit conversion from int to double in the expression Emission / Miles
int VehicleNumber {1}; // declare and assign in 1 statement
\n
cout << "Hello! Please enter the carbon monoxide emission standard. \n";
|
|
Hello! Please enter the carbon monoxide emission standard. 4 Please enter the number of vehicles to be tested. 4 Please enter the number of miles the vehicles were driven. 450 Enter total amount of carbon monoxide emitted in grams for vehicle 1 12 Carbon monoxide emission of 0.0266667 g/mi meets permitted emission of 4g/mi Enter total amount of carbon monoxide emitted in grams for vehicle 2 500 Carbon monoxide emission of 1.11111 g/mi meets permitted emission of 4g/mi Enter total amount of carbon monoxide emitted in grams for vehicle 3 50000 Carbon monoxide emission of 111.111 g/mi exceeds permitted emission of 4g/mi Enter total amount of carbon monoxide emitted in grams for vehicle 4 152 Carbon monoxide emission of 0.337778 g/mi meets permitted emission of 4g/mi |
|
|
|
|
Hello! Please enter the carbon monoxide emission standard: 4 Please enter the number of vehicles to be tested: 4 Please enter the number of miles the vehicles were driven: 450 Enter total amount of carbon monoxide emitted in grams for vehicle 1: 12 Carbon monoxide emission of 0.0266667 g/mi meets permitted emission of 4g/mi Enter total amount of carbon monoxide emitted in grams for vehicle 2: 500 Carbon monoxide emission of 1.11111 g/mi meets permitted emission of 4g/mi Enter total amount of carbon monoxide emitted in grams for vehicle 3: 50000 Carbon monoxide emission of 111.111 g/mi exceeds permitted emission of 4g/mi Enter total amount of carbon monoxide emitted in grams for vehicle 4: 152 Carbon monoxide emission of 0.337778 g/mi meets permitted emission of 4g/mi |