Can someone help with Write a program that determines which of 5 geographic regi
ID: 3632005 • Letter: C
Question
Can someone help withWrite a program that determines which of 5 geographic regions within a major city
(north, south, east, west, and central) had the fewest reported traffic accidents
last year. It should have the following 2 functions which are called by main.
*int getNumAccidents() is passed the name of a region during the last year,validates
the input, then returns it. It should be called once for each city region.
*void findLowest() is passed the 5 accident totals. It determines which is the
smallest and prints the name of the region, along with its accident figure.
INPUT VALDATION: Do not accept an accident number less than 0.
Explanation / Answer
#include #include #include using namespace std; void findLowest(int north, int south, int east, int west, int central,int numAccidents); void findHighest(int north, int south, int east, int west, int central,int numAccidents); int getNumAccidents(string regionName); int main() { string regName; int north, south, east, west, central, numAccidents; cout south) { regName = "south"; numAccidents = south; } if (numAccidents > east) { regName = "east"; numAccidents = east; } if (numAccidents > west) { regName = "west"; numAccidents = west; } if (numAccidents > central) { regName = "central"; numAccidents = central; } coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.