hey guys u no any thing bout tex files...........
any thing?? i have a few questions to figure out.......... but if u have any advice on what i need to no wrt figuring out these coding questions please help me... i would gr8tly appr. it....
heres the question:
and wrt them can u suggest any thing applicable to them and i hope to figure it out....
Write a program to average real numbers input from a text file called “input.txt”. Each line of the text file will contain a single number to be averaged. Collect and sum numbers from the file until there are no more numbers in the file, then compute the average. Write the sum, the number of entries in the file and the average to another text file called “output.txt”.
Create the following text file and use as your input file:
Write a program to produce a sailing table for mariners to the file “sailing.txt”. The program should read the current wind speed in knots from an input file called “speed.txt”, and write a sailing forecast according to the following rules:
If the wind is less than 10 knots, ‘Fair Sailing Ahead’.
If the wind is between 10 and 20 knots, ‘Fair Warning’.
If the wind is between 20 and 30 knots, ‘Experts Only’.
Finally, if the wind is above 30 knots, ‘Use the motorboat!’.
The program should output the wind speed in knots together with the appropriate message.
The program should continue to read and process wind speed values from the input file until there are no more values in the file.
Test your program on the following “speed.txt” file: