Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*When snow depth exceeds 0.65 inches on trunklines and 1.25 inches on Major Streets and 2.75 inches on Local streets
- City crews will start plowing and/or salting City streets.
- Crews will start plowing the local streets as soon as the trunklines and major streets are complete
- If the temperature is below 8 degrees then salting will not be done.
- */
- #include<iostream>
- using namespace std;
- int main()
- {
- float temp,snw;
- char street;
- bool salt,snow;
- cout << "Metropolis 2020 Winter Street Treatment Designation";
- cout << "\n\nWhat is the temperature in degrees(F)? ";
- cin >> temp;
- cout << "How much new Snow depth (in inches)? ";
- cin >> snw;
- cout << "The Street designations are T-Trunkline M-Major Street L-Local";
- cout << "\nWhich do you choose (T,M,L)? ";
- cin >> street;
- if (temp <= 8.0) salt = false; else salt = true; //bool if salt is done or not
- switch(street)
- {
- case 'T':
- if(snw >= 0.65)
- if(salt == 1)
- printf("Given the temperature is %.f degrees and %.3f inches of snow accumulation.\nTrunklines will be Plowed and Salted.",temp,snw);
- else
- printf("Given the temperature is %.f degrees and %.3f inches of snow accumulation.\nTrunklines will be Plowed and not Salted.",temp,snw);
- else
- printf("Given the temperature is %.f degrees and %.3f inches of snow accumulation. \nTrunklines will not be Plowed and not Salted.",temp,snw);
- break;
- case 'M':
- if(snw >= 1.25)
- if(salt == 1)
- printf("Given the temperature is %.f degrees and %.3f inches of snow accumulation.\nMajor Streets will be Plowed and Salted.",temp,snw);
- else
- printf("Given the temperature is %.f degrees and %f inches of snow accumulation.\nMajor Streets will be Plowed and not Salted.",temp,snw);
- else
- printf("Given the temperature is %.f degrees and %f inches of snow accumulation.\nMajor Streets will not be Plowed and not Salted.",temp,snw);
- break;
- case 'L':
- if(snw >= 2.75)
- if(salt == 1)
- printf("Given the temperature is %.f degrees and %.3f inches of snow accumulation.\nLocal Streets will be Plowed and Salted.",temp,snw);
- else
- printf("Given the temperature is %.f degrees and %.3f inches of snow accumulation.\nLocal Streets will be Plowed and not Salted.",temp,snw);
- else
- printf("Given the temperature is %.f degrees and %.3f inches of snow accumulation.\nLocal Streets will not be Plowed and not Salted.",temp,snw);
- break;
- default: cout << "Invalid Street designation";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement