Question: Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays, and a random number generator. Upon program execution, the

Develop a system flowchart and then write a menu-driven C++ program that uses user-defined functions arrays, and a random number generator.

Upon program execution, the screen will be cleared and the menu shown below will appear at the top of the screen and centered. The menu items are explained below.

Help Largest Quit

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 used, and what results would the program produce. Each help screen should remain on the monitor until the user strikes any key. Once the user completes reading the help() screens, striking any key will clear the screen and the menu is displayed again.

The main() function will declare an array of 30 elements. The elements are of type double. The menu option L will ask the user for the actual number of elements for the array. The program must verify that the actual number of elements does not exceed 30 and is not a negative number or 0. Your code must check for these.

L or l( for Largest ) option will invoke a function named largest( ) which will prompt the user for the number of elements for the array to be examined using the function sizeOfArray( ) which will read and validate the desired array elements and returns it to the calling function. The program will then use the returned size of the array to fill the array using the number generator functions shown at the end of this assignment. Your program will ask the user for the range of values for the elements of the array and uses these numbers in a random generator function to fill the array. Once the array is filled, the program will call the function findLargest( ) which will find and return the largest number in the array to the calling function. The program will then call the function frequency(), that will compute and return the frequency of occurrence of the largest number. The program will then display the array elements, the largest number, and its frequency of occurrence using the function display( ), in the format shown below. The output shown is for an array of six elements with an array identifier a.

a[0] = xxxx.xx

a[1] = xxxx.xx

a[2] = xxxx.xx

a[3] = xxxx.xx

a[4] = xxxx.xx

a[5] = xxxx.xx

Largest no. = xxxx.xx Frequency = xx

Note that for the array elements, two digits after the decimal point is required (i.e., 365.24) and the frequence of occurrence is of type integer.

The function prototypes to be used are as follows:

void largest(double s[], int size);

where s is the original array declared in the main() function and size is the maximum array size specified (30 elements in our case).

//gets the desired array size and returns it

int sizeOfArray(void);

//finds the largest number in the array and returns it via the return statement.

double findLargest(double s[], int myS);

//where s is the specified array name and myS is the desired size of the array.

//Finds the frequency of occurrence of the minimum number

int frequency(double s[], double largestNo, int myS);

here, s is the desired source array, largestNo is the largest number found in the function findLargest(), myS is the desired size of the array. The frequency of occurrence of the largest number in the array is computed and returned via a return statement. For the largest number use x >= y when comparing two numbers.

The function display() prototype is:

void display(double s[], double largestNo, int freq, int myS);

where s is the desired array name, largestNo is the largest number in the array, freq is the frequency of occurrence of the largest number, and myS is the desired size of the array. The results should stay on the screen with the following prompt which will appear in the lower right corner of the screen:

Strike any key to continue...

Once the user has entered any key followed by the enter key, the screen will be cleared and the menu is displayed again.

Q or q (for Quit) option will clear the screen and returns the control to the Visual Studio IDE.

Notes:(please read very carefully)

1. Make sure your files are VIRUS FREE! (A grade of 0 will be given for infected files). Use Technology lab PCs for the test.

2. Comment your program.

3. Use meaningful prompts.

4. Provide a brief description of the problem being solved.

5. Be sure to include a header file at the beginning of your program as shown in the course syllabus.

6. NO global declarations of VARIABLES allowed in any program that you develop in this course.

6a. The program uses many user-defined functions as stated in the assignment. You may use additional functions to facilitate your solution. At no time you are allowed to change the essential parts of the problem. Your function arguments cannot be more than five.

7. On the due date, submit your H6 containing the components of the program specified in the guidelines. Create a Word file that contains the header, the flowchart, the list of your .cpp file, and the sample runs of the program. Name this file H6NAME.docx. The source file for H6NAME.cpp and the Visio 2013 file H6NAME.vsdx will be uploaded as well. Unrelated files should not be present when you upload them to the Blackboard. Homework must be uploaded to Blackboard by 9PM of the due date. NAME is your last name.

8. Use Microsoft Visual Studio Enterprise 2015 compiler using default compiler settings.

9. Use Microsoft Visio 2013 to develop your flowchart.

9a. Illegal inputs must be handled properly without terminating the program.

10. Adherence to the ANSI C++ required.

11. Do not use and in this assignment and all other assignments.

12. Do not use any #define in your program until the time that is required for class declaration header files.

13. No goto statements allowed in any program that you develop in this course.

14. Non-compliance with these notes will cost you points.

15. No collaboration on this assignment and all other assignments allowed. If you violate this policy, your grade for the course will be F.

16. You need to show us your flowchart before we can help you with your code.

17. When copying and pasting code into a Word document, please use the Courier New font with a font size no more than 10.

18. Late homework will not be accepted.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!