Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a program flowchart and then write a menu-driven C++ program that will solve the following problem. The menu is shown below. Note: the letters

Develop a program flowchart and then write a menu-driven C++ program that will solve the following problem. The menu is shown below. Note: the letters shown as bold are for emphasis and you do not have to make them bold in your program. The program uses arrays, references, pointers, and functions to accomplish the tasks outlined below.

Help InputData Minimum maXimum miNmax Quit

Upon program execution, the screen will be cleared and the menu shown above will appear at the top of the screen and properly centered. The menu items are explained below. H or h ( for Help ) option will invoke a function named help() which will display a help screen. The help screen(s) should guide the user how to interact with the program, type of data to be entered, and what results would the program produce. Each help screen should remain on the monitor until the user strikes any key (e.g., strike the space bar followed by a carriage return). Once the user strikes a key, the screen will be cleared and the menu is displayed again. Restrictions on the options M, m, X, x, N, and n would be mentioned here.

I or i ( for InputData ) option will prompt the user for the number of inputs to be tested. The program uses this number to fill a double array declared to store up to 35 elements. This option must be executed before options M, X, and N. A boolean flags are to be used here. See data to be used later on this assignment.

M or m ( for Minimum ) option will compute and display the minimum and frequency of occurrences of this minimum on the screen. This option implements the following two function prototypes:

Double~& minfunc(double& d1, double& d2);

void frequency(double& d1, short& freq);

The function minfunc() will receive two references, representing two data items, and returns a reference to the minimum to the calling function. Function frequency() will compute the frequency of occurrences for the minimum number in a data set. This function may be called from within minfunc() function. Once the user viewed the results, striking any key will clear the screen followed by the menu display. This option must be executed after option I or i.

X or x ( for maXimum ) option will compute and display the maximum and frequency of occurrences of this maximum on the screen. This option implements the following two function prototypes:

double& maxfunc( double& d1, double& d2);

void frequency( double& d1, short& freq);// this is the same as above

The function maxfunc() will receive two references, representing two data items, and returns a reference to the maximum to the calling function. Function frequency() will compute the frequency of occurrences for the maximum number in a data set. This function may be called from within maxfunc() function. Once the user viewed the results, striking any key will clear the screen followed by the menu display. This option must be executed after option I or i.

N or n ( for miNmax ) option will compute and display the minimum, the maximum, and their frequencies of occurrences. This option uses the functions mentioned above and the following function prototype:

void minmax( double* minv, short* minFreq, double* maxv, short* maxFreq);

the function minmax() receives values calculated before and processes them accordingly. The minimum value, the maximum value, and their frequencies of occurrences are displayed on the monitor. Once the user viewed the results, striking any key will clear the screen followed by the menu display. This option must be executed after options M and X. Again, you need to have mechanism in place so that this condition is met.

Q or q (for Quit) option will clear the screen and returns the control to the Visual Studio IDE. Sample Data to be used is shown below. Of course, your program will work with any set of numbers within the specified range of elements.

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_2

Step: 3

blur-text-image_3

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

what is a peer Group? Importance?

Answered: 1 week ago