{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Week7_Assignment - Assignment for Chapter 7 Use a single...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment for Chapter 7 Use a single subscripted array to solve the following problem. Write a program that reads an unspecified number of test scores (from 0 to 100%) in random order. Your program should display how many scores are above or equal to the average and how many scores are below the average. Do all your calculations in integer form (i.e., truncate the average). Enter a negative number to signify the end of the input. Assume that the maximum number of scores is 10. Your program must do the following: 1. When a negative number is entered, or after the 10 th value is entered, you must: A. make the textField no longer editable (you may do this by calling the textField’s setEditable method) B. display a message in the status bar indicating that no more data can be entered C. display 3 lines of output: a. The class average is _____ b. The # of scores greater than or equal to the average is ____ c. The # of scores less than the average is _____ 2. Error check the data entered verifying that scores do not exceed 100% (displaying an appropriate error message in the status bar).
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}