/*======== Fall 2022 - CS 112 Week 7 Lab Exercise - Problem 1 - dynamically-allocated arrays Do NOT remove any of the comments below -- ADD the specified statement(s) after each of them. ========*/ /*--- by: ***PUT BOTH of YOUR NAMES HERE*** last modified: 2022-10-07 ---*/ #include <cstdlib> #include <iostream> #include <string> #include <cmath> using namespace std; int main() { cout << boolalpha; //*** DECLARE a pointer to an int named salmon_counts //*** WRITE statements to the screen declaring an int local variable, //*** asking the user HOW many salmon counts will be entered, and //*** reading in what they enter //*** WRITE a statement that causes salmon_counts to point to an //*** appropriate dynamically-allocated ARRAY of the size entered //*** by the user above //*** WRITE a loop that asks the user to enter that many salmon counts //*** and reads them into the array pointed to by salmon_counts //*** (more commonly, we'd now just call this the array salmon_counts, //*** or the DYNAMICALLY-ALLOCATED array salmon_counts...) //*** WRITE a loop that averages the salmon counts in the array salmon_counts //*** (CAREFUL, avoid integer division issues computing the average of //*** these int values!) //*** PRINT a message to the screen including the average computed above //*** of the entered salmon counts //*** DEALLOCATE/free the entire dynamically-allocated array salmon_counts, //*** and then set salmon_counts to point to nothing (following //*** CS 112 course coding standards) return EXIT_SUCCESS; }