Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Write a program that asks the user for a file name. Assume the file contains a series of numbers, each written on a

In C++

Write a program that asks the user for a file name. Assume the file contains a series of numbers, each written on a separate line. Your program should read how many numbers there are in the file and make that value the size of your array, create your own file, I will have my own to run on your program. The program should read the contents of the file into an array and then display the following data:

The lowest number in the array

The highest number in the array

The total of the numbers in the array

The average of the numbers in the array

In addition to your main function, your program should have five functions:

Function that reads the numbers from a file and stores them into an array

Function that finds the lowest value in the array and returns that value. There will be a size parameter which is the number of elements in the array.

Function that finds the highest value in the array and returns that value. There will be a size parameter which is the number of elements in the array.

Function that calculates and returns the sum of the values stored in the array.

Function that calculates and returns the average of the values stored in the array.

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

Visual Basic Net Database Programming

Authors: Rod Stephens

1st Edition

0789726815, 978-0789726810

More Books

Students also viewed these Databases questions

Question

=+2 How can the effectiveness of global virtual teams be improved?

Answered: 1 week ago

Question

=+1 What are the major issues related to international T&D?

Answered: 1 week ago