Write 3 functions: Write  int readNumbersIntoArray(int numbers[], int size); // Reads up to size numbers or a non-numeric and puts them in the array. // Returns how many numbers read. Write  int minOrMax(int numbers[], int size, bool Max); // Returns the minimum or the maximum value in the array depending on "Max". // If "Max" is true, then it returns the maximum. // If "Max" is false, then it returns the minimum. Write double trimmedAvg(int numbers[], int size); // Returns the trimmed average of the array. // A trimmed average is a normal average but leaves out the first instance of // the smallest and largest value in the array when doing the calculation. // HINT: use calls to minOrMax() to get the largest and smallest number. Write  int main(): // Prompt the user for between 3 and 20 numbers and use readNumbersIntoArray() to // read them into an array. Print an error message and exit if less than three numbers. // Print out the min, max, and trimmedAverage of the array using calls to minOrMax() and // trimmedAvg(). User input is shown in bold below: // Sample run 1: Enter from 3 to 20 numbers followed by a non-numeric:  1 2 q Must be between 3 and 20 numbers! // Sample run 2: Enter from 3 to 20 numbers followed by a non-numeric: -8 2 3 -2 57 q Minimum value in the array: -8 Maximum value in the array: 57 Trimmed average of the array: 1 // Sample run 3: Enter from 3 to 20 numbers followed by a non-numeric:  3, -22, 5, 68, 21, -6, 2 q Minimum value in the array: -22 Maximum value in the array: 68 Trimmed average of the array: 5 Write program C++ program with comments.

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

Write 3 functions:

Write 

int readNumbersIntoArray(int numbers[], int size);

// Reads up to size numbers or a non-numeric and puts them in the array.

// Returns how many numbers read.

Write 

int minOrMax(int numbers[], int size, bool Max);

// Returns the minimum or the maximum value in the array depending on "Max".

// If "Max" is true, then it returns the maximum.

// If "Max" is false, then it returns the minimum.

Write

double trimmedAvg(int numbers[], int size);

// Returns the trimmed average of the array.

// A trimmed average is a normal average but leaves out the first instance of // the smallest and largest value in the array when doing the calculation.

// HINT: use calls to minOrMax() to get the largest and smallest number.

Write 

int main():

// Prompt the user for between 3 and 20 numbers and use readNumbersIntoArray() to

// read them into an array. Print an error message and exit if less than three numbers.

// Print out the min, max, and trimmedAverage of the array using calls to minOrMax() and

// trimmedAvg().

User input is shown in bold below:

// Sample run 1: Enter from 3 to 20 numbers followed by a non-numeric: 

1 2 q

Must be between 3 and 20 numbers! // Sample run 2:

Enter from 3 to 20 numbers followed by a non-numeric:

-8 2 3 -2 57 q

Minimum value in the array: -8

Maximum value in the array: 57

Trimmed average of the array: 1

// Sample run 3: Enter from 3 to 20 numbers followed by a non-numeric: 

3, -22, 5, 68, 21, -6, 2 q

Minimum value in the array: -22

Maximum value in the array: 68

Trimmed average of the array: 5

Write program C++ program with comments.

Expert Solution
steps

Step by step

Solved in 4 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
  • SEE MORE 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