Question: Introduction In this assignment you will write a small C+ program. Your program should compile correctly and produce the specified output. Please note that the
Introduction In this assignment you will write a small C+ program. Your program should compile correctly and produce the specified output. Please note that the computer program as has been done in class. For example, there should be a header for the whole program that gives the author's name, class name, date, and description. End braces should be commented, and there are alignment and indenting requirements as discussed. Please ask if you have any questions. should comply with the commenting and formatting rules Purpose Demonstrate the ability to use pointers to handle arrays and variable locations, and accomplish dynamic memory allocation Description Write a C++ program to do the following In the main function display a menu to get user's option for: (15 points) A. Create and initialize a dynamic array B. Display statistics on the array C. Search for an element D. Quit The user should choose A first to proceed with the rest of the options. You need to implement some input validation to make sure that A was chosen before any other option (10 points) When A is chosen: (20 points) Ask the user for an integer value, this value will be used as the size of the array that you will create dynamically. Then call a function with the following prototype and description int *createArray (int &size) Dynamically allocate and inialize with random numbers [80,1001) an array of size size. The parameter to this function is a reference variable which will store the size of the array. The function will return a pointer to the dynamically allocated array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
