Develop a C++ function with following function prototype: double fileAvg(string fname); The function accepts the name of file as input and returns the average of the numbers in that file (the file is...


num 2 in c++


Develop a C++ function with following function prototype:<br>double fileAvg(string fname);<br>The function accepts the name of file as input and returns the average of the<br>numbers in that file (the file is assumed to contain numbers only). Write a<br>C++ main program that prompts the user to enter a file name that contains a<br>set of numbers. The main program should calculate the average of the<br>numbers in the file using the function fileAvg and display the returned value<br>to the user.<br>

Extracted text: Develop a C++ function with following function prototype: double fileAvg(string fname); The function accepts the name of file as input and returns the average of the numbers in that file (the file is assumed to contain numbers only). Write a C++ main program that prompts the user to enter a file name that contains a set of numbers. The main program should calculate the average of the numbers in the file using the function fileAvg and display the returned value to the user.

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here