Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help coding this: A console application that will find the average, minimum, and maximum of a set of numbers. The console application asks the
Need help coding this:
A console application that will find the average, minimum, and maximum of a set of numbers.
- The console application asks the user to enter five numbers and then calculate the average. You'll also need to find the minimum and maximum.
Operation:
- Ask the user to enter 5 numbers.
- After entering the numbers, the numbers are printed to the console, along with the calculated average, minimum, and maximum.
- Ask the user if they would like to save the results to a text file. If they choose yes, save the results and exit. If they choose no, just exit.
Specifications:
- The user should be allowed to enter positive, negative, and decimal numbers.
- Use loops to collect and display the user's input.
You must have a 'function'
- Your function must take an Array (or Vector) as a parameter!
- Your function needs to return the average of the Array or Vector.
- Your function must not print anything to the console (or file)!
- You do NOT need to create functions for the following (but you can add them if you want): Minimum, maximum, save/print to file.
- Do not use any global variables.
- Along with displaying/saving the average, minimum, and maximum; use a loop to print the numbers in reverse order of how they were entered.
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