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 5 names and 5 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 6 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 96 A." Use if...else if...else structure to determine the letter grade of the student with the highest score. Grade Scale: 90-100- A,80-89- B,70-79- C,60-69- D,0-59- 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.
Copy/paste 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, if..else, 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!