Question: Create a new program called GradeReport. In the main method, create two arrays: one for names and the other for grades. Create a method called
Create a new program called GradeReport.
In the main method, create two arrays: one for names and the other for grades.
Create a method called calculateAvg that passes both the arrays as parameters. Method should use a cumulative sum loop to prompt user to enter names and scores validate each score to ensure only numerical values and calculate the average add all scores and divide by number of scores entered Then, return that value to main to use. Once the average is returned, Print each the average of all grades entered using printf command with character spaces wide and right justified.
Create another method called highestGrade. Method should pass parameters the two arrays Compare the scores in the grade array and print which student has the highest score. Based on their score, also print that student's letter grade. Print in quotation marks. Example: "Jane, had the highest score, which was a A Use ifelse ifelse structure to determine the letter grade of the student with the highest score. Grade Scale: A B C D F
Create another method called printArray. Method should pass parameters the two arrays Use the for each enhanced loop to print the elements of each array.
Copypaste your source code once complete.
Note: Pass additional parameters wherever necessary. Use appropriate data types. Program should show use of loops, variables, passing parameters, returning values, logical operators, ifelse, escape sequences, retrieving input, constructing, traversing arrays, validating input.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
