C++ programming

Using Pointer Notation and Dynamic Memory Allocation

  1. You are working for a local Laundromat and you need to create a program that allows the owner to keep track of various business statistics and revenue. All the statistics and revenue is based on the number of loads that are washed by the patrons on a given day. In main, ask the user how many different days they will be entering. (Input 11 when running the program; that is the test data). Validate the input for > 0 input.
  2. In main, dynamically allocate an array large enough to hold a user-defined number of days.
  3. In main, fill an array with the number of loads per day. These values are input by the user. Validate input for the range of 0 to 25.

Test Data: 16, -5 , 22 , 27, 25, 18, 12, 29, 24, 25, 25,18, 15, 13

  1. The data should be saved into the array using pointer notation. There must be no use of array notation in this lab.
  2. Once the data is entered, pass the array to a function to determine the average number of loads for the number of days entered. Here is the function header.

Sample Solution