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:  Write a function to display some heading with useful information which will display on the screen for the user. Write a void function that prints the list of nonnegative integers in reverse. 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. Write a function that determines the largest value stored in the array and returns that value to the calling function main. Write a function that determines the number of even integers stored in the array and returns that value to the calling function main. Write a function that calculates the average of the values stored in the array and returns that value. to the calling function main. Write the function calls with the appropriate arguments in the function main. Any values returned will be output.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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.
// 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 completed
Transcribed Image 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 completed
77-------
//
//add the block comment for the program
//
//---
#include <iostream>
//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;
Transcribed Image Text:77------- // //add the block comment for the program // //--- #include <iostream> //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;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education