Question: Please complete the following code! import java.util.Scanner; public class GradeCalculator { / * PUT THE SETUP SECTION VARIABLES DIRECTLY BELOW THESE COMMENTS: Define the four

Please complete the following code!
import java.util.Scanner;
public class GradeCalculator
{
/*PUT THE SETUP SECTION VARIABLES DIRECTLY BELOW THESE COMMENTS:
Define the four weight variables outlined in the set up section below
All variables in this section must adhere to the conventions for constants. See instructions for specific details*/
public static UserInputResult GetUserInput()//DO NOT ALTER THIS LINE
{
Scanner scanner = new Scanner(System.in);//DO NOT ALTER THIS LINE
/*PUT THE INPUT SECTION VARIABLES DIRECTLY BELOW THESE COMMENTS:
Define the four score variables outlined in the input section below within the scope of the GetUserInput method.
A scanner variable has been provided for getting user input.*/
scanner.close();//DO NOT ALTER THIS LINE
return new UserInputResult(quizScore, assignmentScore, midtermExamScore, finalExamScore); //DO NOT ALTER THIS LINE
}
public static float CalculateFinalScore(float quizScore, float assignmentScore, float midtermExamScore, float finalExamScore)//DO NOT ALTER THIS LINE
{
/*PUT THE PROCESSING CALCULATION DIRECTLY BELOW THESE COMMENTS:
Calculate the final score using the weight and score variables defined in the set up and input sections within the scope of the CalculateFinalScore method.
Hint: The static variables from the set up section can be used directly here alongside the score variables that have been passed in
*/
return finalScore; //DO NOT ALTER THIS LINE
}
public static void main(String[] args)//DO NOT ALTER THIS LINE
{
UserInputResult result = GetUserInput(); //DO NOT ALTER THIS LINE
float finalScore = CalculateFinalScore(result.quizScore, result.assignmentScore, result.midtermExamScore, result.finalExamScore); //DO NOT ALTER THIS LINE
/*PUT THE FINAL OUTPUT DIRECTLY BELOW THESE COMMENTS:
Output the final score to the user in the format described in the output section within the scope of the main method.
The output section directions has information about String.format and what format specifier to use.*/
}
}
The Rubric: Full name in header comments: 2pts
Proper variable creation for all four weight variables: 3pts
Proper variable creation and input processing for all four score variables 3pts
Proper calculation of the final_score: 3pts
Properly formatted input prompts: 2pts
Properly formatted final output: 2pts
The program is Java! Thanks!

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 Databases Questions!