Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for c++ please help Write a program to determine if vehicles tested for identical miles meet a carbon monoxide emission standard for g/mi.

This is for c++ please help

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

2. the number of vehicles in the test

3. the number of miles all vehicles were driven

Input 2: (prompt for and input this data for each vehicle) (see the sample run below):

1. The total amount of carbon monoxide emitted for the next vehicle in the test (note that the vehicle number is output in the prompt)

Output: (see the sample run below):

1. Vehicle emission in g/mi during the test

2. An indication of whether or not the vehicle emissions met the standard

3. Include all pertinent information as shown in the sample

output example

enter the carbon monoxide emission standard: 3.2

enter the number of vehicles to be tested: 3

enter the number of miles the vehicles were driven: 15

enter the total amount of carbon monoxide in grams for vehicle 1: 56

carbon monoxide emission of 3.73333 g/mi exceeds permitted emission of 3.2 g/mi

enter the total amount of carbon monoxide in grams for vehicle 2: 34

carbon monoxide emission of 2.26667 g/mi meets permitted emission of 3.2 g/mi

enter the total amount of carbon monoxide in grams for vehicle 3: 23

carbon monoxide emission of 1.53333 g/mi meets permitted emission of 3.2 g/mi

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions