Scenario

A group of geologist are interested in a C++ application that is capable of accepting and processing data related to sites that they monitor across the island. A value between 1 and 10 (inclusively) is used to represent a geologist's observation for an activity at a site. At minimum, each geologist will observe 10 sites for 10 days. Using an array, the minimum data for a geologist's site could be represented as follow: see image.

For example, at site 1 on day 1 (A11) and at site 9 on day 7 (A97), the values 5 and 1 are seen respectively - indicating the geologist's rating for an activity at site 1 and site 9.

Tasks

You will implement a menu-driven C++ application that will model the following tasks to be accomplished by each geologist.

Create A. - Upon the user selecting this option, your C++ application will create an integer pointer variable called A within your application's main function. This pointer variable will be used to store the values representing a geologists observation for each site for each day. Your solution is required to call a function which accepts two integer values as its arguments, m and n, and returns a pointer to the newly created m by n integer array. You are to ensure that values for the minimum days and sites are validated before creating the m by n integer array. Note, the returned result of your function is expected to be assigned to A in your main function.

Populate A. - Upon the user selecting this option, your main function will call another function to assist it in randomly assigning integer values to each location in A. You are to ensure that only valid values are generated and stored - as used by a geologist for recording their observations.

Scale A. - Upon the user selecting this option, your main function will call another function to assist it in performing a scalar multiplication - this is to be done by multiplying all integer values in A with a user's inputted integer value. Only values between 2 and 10 (inclusively) are to be accepted and used to perform this scalar multiplication.

Compute Percentage. - Upon the user selecting this option, your main function will display the highest and lowest values in A, and then create an n by 1 integer array called percentage. Your solution will then prompt the user to enter a value within the range of the highest and lowest displayed values. Next, for each site in A, your main function will compute and store the percentage of values that are greater than the user's accepted value. Your solution will store the respective percentages obtained for each site in the array called percentage.

Exit Program. - Upon the user selecting this option, your main function will prompt the user to confirm their choice to exit your application. Only if the user confirms the choice to exit should your application close; otherwise, it repeats the menu options for your user.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.