I will prepare files of “random” integers for you. The numbers will be stored 1 per line. Your program will:
Prompt the user for the name of the datafiles to use (note: you can call your output file anything you
want…within reason).
While there is data in the file
Read an integer
If the integer is even, add it to the even sum
If the integer is odd, add it to the odd sum
Be sure to check for an empty file. If there is, report this to the user and stop the program right there (exit).
o When there is no more data, output the sum of the even integers and the sum of the odd integers TO A TEXTFILE.
When I compile it doesn't seem to find the text or I may be doing something wrong
my ouput:
Enter file name: Ints1.txt
File not found or cannot be opened.
Make sure path is correct.
Press any key to continue . . .
I moved them to HW9 and I am still getting the same error. this is how I am calling it:
Enter file name: c:\libraries\documents\HW9\Ints1.txt
maybe this is where the erros is?
That would meant that I wouldn't allow the user to enter the file name if i put it directly on my code. And I need to let the user be able to enter their own file name.