Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help writing code for a program using Loops. Below is the instructions Write a program to determine if vehicles tested for identical miles meet a
Help writing code for a program using Loops. Below is the instructions
Write a program to determine if vehicles tested for identical miles meet a carbon monoxide emission standard for g/mi. Your program should first input the standard to be used, the number of vehicles that were tested, and the number of miles in the test. Then it should loop and ask for the emissions level for each vehicle in the test and output a message indicating if it meets the standard. Input 1: prompt for and input this data before the loop (see the sample run below): 1. the amount of allowable carbon monoxide in grams per mile the number of vehicles in the test the number of miles all vehicles were driven 2. 3. Input 2: (prompt for and input this data for each vehicle) (see the sample run below) The total amount of carbon monoxide emitted for the next vehicle in the test (note that the vehicle number is output in the prompt) 1. Output: (see the sample run below): 1. 2. 3. Vehicle emission in g/mi during the test An indication of whether or not the vehicle emissions met the standard Include all pertinent information as shown in the sample CAUsersUil Desktop\MiamnCSE 1531Programs NewCarEmi.. noxide emission standard: 3.2 nter the number of vehicles to be tested: 3 nter the number of miles the vehicles were driven: 15 nter total amount of carbon monoxide emitted in grans for vehicle 11 56 arbon monoxi de emission of 3.73333 /mi exceeds permitted enission of 2 c/m nter total amount of carbon monoxide enitted in grams for vehicle 2: 34 arbon monoxide emission of 2.26667 i meets permitted emission of 2 g/mi nter total amount of carbon monoxide emitted in grams for vehicle 3: 23 arbon monoxide emission of 1.53333 g/mimeets permitted emission of 2 E/ma 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