It uses a one-dimensional array. You can refer to the PowerPoint slides, many of the tasks can be found there, but you need to apply them for this program. Note that the array will be filled with the...


It uses a one-dimensional array.  You can refer to the PowerPoint slides, many of the tasks can be found there, but you need to apply them for this program. Note that the array will be filled with the integers when the user enters them. Consider the proper layout and correct indentation.


Consider the following program that reads a number of nonnegative integers into an array and prints the contents of the array. You will add to the program.  Complete the missing parts, add new function prototypes and function definitions, and test the program several times.  Do not do it all at once.
Add the following to the program
:



  1.  Write a function to display some heading with useful information which will display on the screen for the user.

  2. Write a void function that prints the list of nonnegative integers in reverse.

  3. Write a void function that prints all the numbers stored in the list that are
    greater than 10. It will also print the number of such numbers found.

  4. Write a function that determines the largest value stored in the array and
    returns
    that value to the calling function main.

  5. Write a function that determines the number of even integers stored in the array and
    returns
    that value to the calling function main.

  6. Write a function that calculates the average of the values stored in the array and
    returns
    that value. to the calling function main.

  7. Write the function calls with the appropriate arguments in the function
    main. Any values returned will be output.

  8. Write appropriate block
    comments
    for
    each function header
    similar to the ones provided. Show your understanding of the program and thus provide useful information to the reader.

  9. Test all the functions using appropriate test data. Write the documentation and include the screenshots.  Add the source code by copy and paste to the document.


// Definition of function ReadList.<br>// This function reads nonnegative integers from the keyboard into an array.<br>// The parameter list is an array to hold nonnegative integers read.<br>// The parameter length is a reference parameter to an int. It holds the<br>// number of nonnegative integers read.<br>void ReadList ( int list [], ints length)<br>int number;<br>int index - 0:<br>cout « > number: //read the first integer entered //check that the number is nonnegative and // the size of the array is not exceeded while ber >-0 66 < max_size)="" list="" [index)="" -="" number;="" store="" the="" integer="" in="" the="" array="" increment="" the="" index="" read="" the="" next="" integer="" length="" is="" the="" number="" of="" nonnegative="" integers="" length="" -="" index:="" in="" the="" list="" ******.......="" *******="" **.="" definition="" of="" function="" printlist.="" the="" function="" prints="" the="" nonnegative="" integers="" in="" the="" array="" list="" and="" the="" number="" of="" integers="" in="" the="" array.="" the="" parameter="" list="" holds="" the="" nonnegative="" integers="" the="" parameter="" length="" holds="" the="" number="" of="" nonnegative="" integers.="" **********="" ******="" **="" *******="" void="" printlist="" (const="" int="" list[],="" int="" int="" index;="" cout="" «="" "\nthe="" list="" contains="" "="" «="" length="" «="" "="" nonnegative="" integer="" (s)="" as="" follows:="" \n":="" to="" be="" completed="" "/="">
Extracted text: // Definition of function ReadList. // This function reads nonnegative integers from the keyboard into an array. // The parameter list is an array to hold nonnegative integers read. // The parameter length is a reference parameter to an int. It holds the // number of nonnegative integers read. void ReadList ( int list [], ints length) int number; int index - 0: cout « "Enter nonnegative integers each separated by a blank space, \n" «" and mark the end of the list with a negative number: "; cin >> number: //read the first integer entered //check that the number is nonnegative and // the size of the array is not exceeded while ber >-0 66 < max_size)="" list="" [index)="" -="" number;="" store="" the="" integer="" in="" the="" array="" increment="" the="" index="" read="" the="" next="" integer="" length="" is="" the="" number="" of="" nonnegative="" integers="" length="" -="" index:="" in="" the="" list="" ******.......="" *******="" **.="" definition="" of="" function="" printlist.="" the="" function="" prints="" the="" nonnegative="" integers="" in="" the="" array="" list="" and="" the="" number="" of="" integers="" in="" the="" array.="" the="" parameter="" list="" holds="" the="" nonnegative="" integers="" the="" parameter="" length="" holds="" the="" number="" of="" nonnegative="" integers.="" **********="" ******="" **="" *******="" void="" printlist="" (const="" int="" list[],="" int="" int="" index;="" cout="" «="" "\nthe="" list="" contains="" "="" «="" length="" «="" "="" nonnegative="" integer="" (s)="" as="" follows:="" \n":="" to="" be="">
77-------<br>//<br>//add the block comment for the program<br>//<br>//---<br>#include <iostream><br>//for cin, cout<br>using namespace std;<br>const int MAX_SIZE = 20;<br>// maximum size of array<br>//function prototypes<br>void ReadList ( int [], inta);<br>void PrintList (const int [], int);<br>int main ()<br>int list (MAX_SIZE);<br>int numberofIntegers;<br>// array of nonnegative integers<br>// number of nonnegative integers in array<br>ReadList (list, numberofIntegers);<br>PrintList (<br>to be completed<br>Call the functions<br>7/output your name etc.<br>system (

Extracted text: 77------- // //add the block comment for the program // //--- #include //for cin, cout using namespace std; const int MAX_SIZE = 20; // maximum size of array //function prototypes void ReadList ( int [], inta); void PrintList (const int [], int); int main () int list (MAX_SIZE); int numberofIntegers; // array of nonnegative integers // number of nonnegative integers in array ReadList (list, numberofIntegers); PrintList ( to be completed Call the functions 7/output your name etc. system ("pause"): return 0;
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here