7.Write a complete Java program (including import statements, comments and all variable declarations and initialization where needed) for the following problem. DO NOT USE ARRAYS The program will read...


7.Write a complete Java program (including import statements, comments<br>and all variable declarations and initialization where needed) for the<br>following problem. DO NOT USE ARRAYS<br>The program will read from the keyboard an unknown number of student<br>records. Each record contains the ID number (integer) and three test<br>scores (double) of a student. A value of the ID greater than 999<br>indicates to stop reading data.<br>Sample input:<br>167 87 90 92<br>763 72 97 88<br>512 134 87 76<br>440 89 96 -10<br>1000<br>I.<br>Ask the user to enter the first ID<br>Using a loop of your choice:<br>a. If the IDis greater than 999 then terminate reading data -<br>do not read in any test scores but go to step IV.<br>b. If the ID is less than or equal to 999, continue with step<br>III.a.<br>II.<br>III.<br>a. Read in the three test scores and compute their average<br>b. If any of the test scores is less than 0 or greater than<br>100, print an error message that the test scores are<br>invalid and include the ID of that record in the error<br>message. Keep track of how many records with errors were<br>read in. Do not process the record. Skip to step III.g.<br>c. Print the ID, the three test scores and the average (with 1<br>decimal place) to the console.<br>d. Keep a running sum of the test score averages<br>e. Keep a count of how many students were read in<br>f. Keep track of the highest average test score and the ID<br>associated with that average<br>g. Read in the next ID<br>h. Return to step II.a.<br>IV.<br>When an ID greater than 999 is read in, do as follows:<br>If the number of records read in is 0, then print

Extracted text: 7.Write a complete Java program (including import statements, comments and all variable declarations and initialization where needed) for the following problem. DO NOT USE ARRAYS The program will read from the keyboard an unknown number of student records. Each record contains the ID number (integer) and three test scores (double) of a student. A value of the ID greater than 999 indicates to stop reading data. Sample input: 167 87 90 92 763 72 97 88 512 134 87 76 440 89 96 -10 1000 I. Ask the user to enter the first ID Using a loop of your choice: a. If the IDis greater than 999 then terminate reading data - do not read in any test scores but go to step IV. b. If the ID is less than or equal to 999, continue with step III.a. II. III. a. Read in the three test scores and compute their average b. If any of the test scores is less than 0 or greater than 100, print an error message that the test scores are invalid and include the ID of that record in the error message. Keep track of how many records with errors were read in. Do not process the record. Skip to step III.g. c. Print the ID, the three test scores and the average (with 1 decimal place) to the console. d. Keep a running sum of the test score averages e. Keep a count of how many students were read in f. Keep track of the highest average test score and the ID associated with that average g. Read in the next ID h. Return to step II.a. IV. When an ID greater than 999 is read in, do as follows: If the number of records read in is 0, then print "No records read in" and end the program If the number of records read in is at least 1, then print the following, each with a description: i. The total number of records read in. ii. The number of records with errors. a. b. iii. The overall average for all students. iv. The highest average score and the ID of the student with that average.
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here