Question: PLEASE FIX MY CODE FILE IT WONT OPEN #include #include using namespace std; int main ( ) { ifstream inputfile ( Numbers . txt
PLEASE FIX MY CODE FILE IT WONT OPEN #include
#include
using namespace std;
int main
ifstream inputfileNumberstxt;
int count ;
int sumFirst;
int sumFirst;
int minVal, maxVal;
int num;
Check whether the file exists and opened successfully
if inputfile.isopen
cout
Error: Can't open file or File does not exist!" endl;
return ;
while inputfile num
increment the number count
count;
Determine minimum and maximum value
if count
minVal num;
maxVal num;
else
if num minVal
minVal num;
if num maxVal
maxVal num;
sum first and numbers
if count
sumFirst num;
if count
sumFirst num;
double averageFirst sumFirst;
display output
cout A Count of numbers in the file: count endl;
cout B Average of the first numbers: averageFirst endl;
cout C Sum of the first numbers: sumFirst endl;
cout D Minimum value found in the file: minVal endl;
cout E Maximum value found in the file: maxVal endl;
inputfile.close;
return ;
#EncludeD Error: Can't open file or File does not exist!
Process finished with exit code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
