I also couldn't figure out how do do this one. It's the last one I have to do, I promise ;). It involves doing stuff with a text file (which I uploaded onto the internet).
The question goes like this:
The Student Cd contains a file named random.txt [I uploaded it to http://d01.megashares.com/?d01=3251418]. This file contains a long list of random numbers. Copy the file to your hard drive and then write a program that opens the file, reads all the numbers from the file, and calculates the following:
A) The number of numbers in the file
B) The sum of all the numbers in the file ( a running total)
C) The average of all the numbers in the file
The program should display the numbers of numbers found in the file, the sum of the numbers, and the average of the numbers.
I really appreciated the help, I wish they had more examples in the book for this stuff. Thanks for taking the time.
2007-03-28
14:57:09
·
2 answers
·
asked by
Stash O
3
in
Programming & Design