Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C Programming NOTE: We have only covered up to nested loops to this point. Please do not use functions other than main(), arrays, or pointers,

C Programming

NOTE: We have only covered up to nested loops to this point.

Please do not use functions other than main(), arrays, or pointers, ...No additional libraries besides

If you use anything other than very basic code using nested loops it will confuse me further. Thank you!

image text in transcribed

4.13 Lab: Min, Max, Mean Write a program that finds the smallest (min), largest (max), and average (mean) of N values entered by the user. Your program should begin by prompting the user for N, the number of values to be entered. Then the program should accept that number of values, determining the min, max, and mean. Then it should display those values When scanning for a value for N, the program should use error checking to protect against erroneous inputs from the user and only accept positive integer values. The other values entered can be any value, but error checking should still be employed to ensure that the user entered a value. If there is ever an incorrect input the user should be re-prompted for the value and told of the error Steps for the program: Prompt the user for N Scan the value of N Prompt and Scan for N Values o Simultaneously search for Max and Min values o Add all values to generate a sum Calculate the average by dividing the sum by N, MEAN-sum/N Display min, max, and mean values An example run of the program is given below where the user enters five values (ie N-5) MIN, MAX, and MEAN CALCULATOR How many values are to be entered?:-4 INPUT ERROR! How many values are to be entered?: 4 Value1:2 Value 2: as INPUT ERROR! Value 2:17 Value3:3 Value 4:5 The minimum value is 2, the maximum value is 17, and the average value is 6.75

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 Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

Students also viewed these Databases questions