September 1998
Intermediate to advanced
848 pages
20h 13m
English
Now that you've seen the mechanics of writing array functions, let's try a more programming-oriented example. Our self-appointed task is to write a program that reads numbers into an array, prints the entered numbers, and reports the average. To make the program more realistic, require that it allow the user to terminate input, if desired, before the array is filled. This will enable the program to process any number of items up to a maximum determined by the array size. Also, you want to avoid calculating the average if no numbers are entered.
Conceptually, the program should perform three major tasks: reading in a set of numbers, printing the set of numbers, and calculating the average. Now that you know how ...
Read now
Unlock full access