#include <iostream>
using namespace std;
int getInput()
{
cout << "Enter Air Pollution Index: ";
int api;
cin >> api;
return api;
}
string API_CATEGORY (int api)
{
if (api >=0 && api <=50)
return "Good";
if (api >=51 && api <=100)
return "Moderate";
if (api >=101 && api <=200)
return "Unhealthy";
if (api >=201 && api <=300)
return "Very unhealthy";
if (api >=301 && api <=500)
return "Hazardous";
return "Emergency";
}
int main()
{
int api = getInput();
cout << "API status: " << API_CATEGORY(api);
return 0;
}
Comments
Leave a comment