Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program which prompts the user to enter the number of values to process (a maximum of 100). Next prompt, and allow the user

Write a program which prompts the user to enter the number of values to process (a maximum of 100). Next prompt, and allow the user to enter each of the values. Store these values in an array. Print the largest value, the smallest value, and the average (to 2 decimal places) of the values in the array. You must use functions for each of these tasks. The GetValues() function is the only function that may change the array. image text in transcribed
0Rte a program which prompts the user to enter the number of values to process tore these values in an array. Print the largest value, the smallest value, and the average (to 2 decimal places) of the values in the array. You must use functions for each of these tasks. The due: see http llece160.org (a maximum of 100). Next prompt, and allow the user to enter each ot the values change the array The prototypes for the functions must be: GetValues() function is the only function that may void GetValues (int x[l,int pa) int FindBig (int xl, int n); int FindSml (int xl. int n): float FindAvg (int x. int n); Getvalues should put values in both the xt1 array and at pu FindBig should return the largest integer in the first n elements of xt Findsml should return the smallest integer in the first n elements of x FindAvg should return the average of the first n elements of x t1 Thus, the main program should exactly something like the following #de fine CRTSECURENOWARNINGS #include // prototypes as listed above void main) - - - int at1oo], myBig, mysml, n; float myAvg: GetValues (a, &n); myBig-FindBig(a,n) mySml-Findsml (a,n); myAvg-FindAvg (a,n) printf ("The largest value is: sdIn" ,myBig) ; printf ("The smallest value is: tdn ,mySm1) printf ("The average value is: %,2f ".myAvg); A sample run is shown below (user input underlined). Note that user is prompte for value 1, 2, 3, as opposed to 0, 1, 2, Enter number of integer values: 5 Enter value 1: 20 Enter value 2: -15 Enter value 3: 90 Enter value 4 2 Enter value 5 30 The largest value is: 90 The smallest value is: -15 The average value is: 25.40

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_2

Step: 3

blur-text-image_3

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions