CS 1073 Introductory Programming
for Scientific Applications
Arrays and Loops


Exam Scores in an Array: This first Java program reads exam scores, similarly to the example Loop Patch. However, this example stores the scores in an array, for use later. The inputting of ints uses the functions in Homework 3: Print a Tree (shown in dark yellow below). All the program below does is to print the scores that were read in.

Here are results of runs with with two different sets of scores boldface is data entered):


Working With Data in an Array: Once the scores have been read into an array, they are readily available, and we can do anything we want with them, including calculating their average, the minimum and maximum score, and anything else we can imagine. (The program below doesn't include the two yellow functions above, but they have to be present.)

Here are results of runs with with two different sets of scores boldface is data entered):