| CMPSC 101 - Strings Files & Arrays Worksheet #3 | Name - |
1. Assume that a sequential access file named "Grades.txt" contains
the following data:
Bill
A
Jan
B
Phil
C
Doris
A+
Fred
B
Write a program that reads each line and stores the values into a two-dimensional
array of strings named grades, where grades has 5 rows and 2 columns. The names
should be stored in the first column and the letter grades should be stored
in the second column.
2. Write a program that reads the data from a sequential file named "GameScores.txt"
where the data is stored like this:
Fred 123 189 123
Barney 145 176 125
Wilma 209 187 195
Betty 145 142 156
BamBam 187 167 168
The program should store the names in a one-dimensional array named bowlerNames and the integers in a two-dimensional array of integers named gameScores. The program should compute each players average and store those values in a parallel array of doubles named bowlerAverages.