Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions