Question
In Java, your first programming assignment is to write a program to average a maximum of 100 test scores. This program must be idiot proof,
In Java, your first programming assignment is to write a program to average a maximum of 100 test scores. This program must be "idiot proof", which means that it must error trap all input and not allow invalid data to be entered by the user. The program will begin by prompting the user for how many test scores they would like to average. Note that the maximum number the user may enter is 100. Also note that the user must enter a positive number greater than or equal to one. If the user enters an invalid number, you must display an appropriate error message and re-prompt the user for the data. The program should not proceed until a valid number is entered. Once it is determined how many test scores should be averaged, you should write a loop to prompt the user for that number of test scores. Note that when prompting the user for the score, the prompt should display which score they are entering. For example, the first prompt could be: Enter test score #1: The prompt for the second score could be: Enter test score #2: As each test score is entered, it must be checked to ensure it falls within the range from 0-100, inclusive. If any score is not with the acceptable range, an appropriate error message should be displayed and the user should be ask to re-enter the score. The program should not proceed within the loop until a valid score is entered. Note that all individuals scores will be integers (whole numbers). Note: When prompting the user for a number (number of tests, individual test scores, etc), you may assume that they will be entering a numeric value and do not have to error trap for characters. This will be an error trap we will address at a later time. After all of the scores are entered and validated, the program should display the following information: Total number of test scores: xxx Average of all test scores: xxx.xx Be sure to use appropriate documentation throughout the program. Save your source code under the name: FirstProg.java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started