Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program below needs to be in C++ need before 2/23 thanks Write a program that determines which of five geographic regions within a major

This program below needs to be in C++ need before 2/23 thanks

Write a program that determines which of five geographic regions within a major city (north, south, east, west, and central) had the fewest reported automobile accidents last year. It should have the following two functions, which are called by main.

int getNumAccidents() is passed the name of a region. It asks the user for the number of automobile accidents reported in that region during the last year, validates the input, then returns it. It should be called once for each city region.

string findLowest() is passed the five accident totals and a 6th parameter that will have the value of the lowest total. It determines which is the smallest region and sets the lowest total parameter accordingly and returns the name of the lowest region.

double determine Average() - is passed the five accident totals. It returns the average number of accidents per region across the state.

Your program should output the name of the region with the lowest number of accidents, the lowest number of accidents, and the average number of accidents for the state. Note The rubric is now changing for the remainder of the term. Functions will be expected in all programs. Keep in mind having functions for input, processing, and output in all programs. The required functions may not be the only functions your program will use.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions