Answered step by step
Verified Expert Solution
Question
1 Approved Answer
double average Cconst double data[ size t n) Precondition: data is an array with at least n components, and n 0. Postcondition: The value returned
double average Cconst double data[ size t n) Precondition: data is an array with at least n components, and n 0. Postcondition: The value returned is the average of data10..dataln -1J. void compare(const double data[ J, size t n, double value); Precondition: data is an array with at least n components. Postcondition: The values dataloj through dataln 11 have been printed with a message saying whether they are above, below, or equal to value. int main double numbers Will point to the first component of an array size t array size double mean value Allocate an array of doubles to hold the user's input. cout "This program will compute the average of some numbers. The "; cout "numbers will be stored in an array of doubles that I allocate. n"; allocate doubles (numbers, array size) Read the user's input and compute the average. fill array numbers array size) mean value average numbers array size) Print the output. cout "The average is mean value end compare numbers array size, mean value) cout "This was a mean program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started