Question: Please help with this. Is it possible to use a switch statement? For this project you will write a program which determines if the amount

Please help with this. Is it possible to use a switch statement?

Please help with this. Is it possible to use a switch statement?

For this project you will write a program which determines if the

For this project you will write a program which determines if the amount of pollutants a car currently emits meets or exceeds the legal limits. You will use the following table to determine an appropriate message to print. Write a program that accepts as input a pollutant number (integer), a number of grams emitted per mile (real), and an odometer reading (integer), and then prints an appropriate message indicating whether or not the emissions meet or exceed the legal limit for the vehicle. Note: the "limit" is the highest value acceptable for a given case. For example, a limit of 3.4 means that up to and including 3.4 is ok, but anything higher, is not ok. Input/Output and Example Test Data Sets Read the data items interactively, that is, let the user type in the values needed. Your program does not have to check for bad data or handle invalid data entries, i.e. you may assume that all input data is valid and appropriate for this task. Test your program thoroughly, using test data which will exercise all the branches and cutoff points in the program. For example, some possible data sets are shown below. Also make up your own test data and run your program with other data values, in order to thoroughly check it. You will need to check your results carefully. Note that the grader will run your program interactively and test it with other valid data sets created by the teaching staff, in order to test for whether the program works properly or not. Sample Run Output If you input the following values: 1, 3.5 and 36123 , your program output might look something like: Please enter a pollutant number 1 - Carbon monoxide 2 - Hydrocarbons 3 - Nitrogen oxide 4 - Nonmethane hydrocarbons 1 Please enter the pollutant emissions in grams per mile 3.5 Please enter the current odometer reading -> 36123 This car *DoEs NoT MEET* the legal limits for this pollutant. Thanks for using the Auto Emissions Analyzer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!