Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a c program that reads in the daily hazard index for each of the three pol

ID: 3584850 • Letter: W

Question

Write a c program that reads in the daily hazard index for each of the three pollutants and that

identifies the smog level of the air as low or medium or first-stage alert or second-stage alert.

If all indices are less than or equal to

100, the smog level listed as “low” in forecasts. If any index rises above 100, the smog level

is listed as “medium”. If any index rises above 200, the smog level is listed as a “first-stage

alert”. If any index exceeds 275, the smog level is listed as a “second-stage alert”.

Explanation / Answer

string smogLevel;

if(index1<=100 && index2<=100 && index3<=100)

smogLevel="low";

if(index1>100 || index2>100 || index3>100)

smogLevel="low";

if(index1>200 || index2>200 || index3>200)

smogLevel="first-stage alert";

if(index1>275 || index2>275 || index3>275)

smogLevel="second-stage alert";

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote