carter
03-12-04, 06:47 AM
Write a program to read in the number of loads of turf produced by 4 farmers in 3 different summers into a 2-D array. You must print them out in a table and to a file (bog.txt, stored in a directory of your choosing) and calculate the worst turf producer over the 3 years (average - 1 decimal place). Turf loads for a given summer should be in the range 0-40. You may assume that there will be no joint top producers.
Notes:
1. You must use functions to:
a. Print an introductory message and instructions on screen
b. Input the 4 farmer names (one function)
c. Input the turf loads and calculate averages (one function) - you may store averages in an extra column in the 2D array
d. Determine the lowest average turf loads tally
e. Output the results in formatted table to screen
f. Output the same results in formatted table to file
2. You must store the farmer names as strings (max. 15 characters)
3. You must append the data to the text file. This will give you a complete record of your program executions.
I have got most of this done except I can't quite get it to work any help would be great.
Notes:
1. You must use functions to:
a. Print an introductory message and instructions on screen
b. Input the 4 farmer names (one function)
c. Input the turf loads and calculate averages (one function) - you may store averages in an extra column in the 2D array
d. Determine the lowest average turf loads tally
e. Output the results in formatted table to screen
f. Output the same results in formatted table to file
2. You must store the farmer names as strings (max. 15 characters)
3. You must append the data to the text file. This will give you a complete record of your program executions.
I have got most of this done except I can't quite get it to work any help would be great.