Exercise 2: More Counting... (30%)




Document: Software Engineering 1: Lab Exercises

next Exercise 3: Statistics (20%)
up Session 10: Week 20/21: Letter Frequencies
gif Exercise 1: Counting A! (30%)

Exercise 2: More Counting... (30%)

Now enhance your program to count how many times each separate alphabetic character occurs. Again, it should ignore distinctions between upper and lower case, and should ignore all non-alphabetic characters. So it should generate 26 distinct count values, one for each letter of the alphabet, and not counting non-alphabetic characters at all.

Note that you can use a single array, with 26 elements (where the elements are of type int, say), to hold all the counts. You will need to think carefully about how to access the correct position or slot in this array to get the correct count for any given letter found in the file.

When the file has been completely read, the program should output a table showing the count for each of the letters A to Z.

Again, you should test your program carefully, and document any problems etc. in your report.




Document: Software Engineering 1: Lab Exercises

next Exercise 3: Statistics (20%)
up Session 10: Week 20/21: Letter Frequencies
gif Exercise 1: Counting A! (30%)



McMullin@eeng.dcu.ie
Tue Apr 30 14:15:37 GMT 1996