Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The main method below calls four other methods - namely readInput, computeAverageOfThreeScores, computeLetterGrade and printOutput. The readInput and printOutput methods have already been written. You

The main method below calls four other methods - namely readInput, computeAverageOfThreeScores, computeLetterGrade and printOutput. The readInput and printOutput methods have already been written. You are to write the other two methods that belong in the class. You will be prompted for each method and you are to write the code for each method inside the text area after the prompt. If you provide the correct response, the program should run correctly as indicated in the sample I/O sequence. Note: Your methods must make the program yield the outcome shown in the sample console I/O sequence. //---- Grader.java import java.util.Scanner; public class Grader { private int score1, score2, score3; double averageScore; private char grade; public void readInput() { Scanner kbd=new Scanner(System.in); System.out.print("Enter 3 scores between 0 and 100 each: "); score1=kbd.nextInt(); score2=kbd.nextInt(); score3=kbd.nextInt(); } //---- Write the computeAverageOfThreeScores method below. //---- Write the computeLetterGrade method below. Scale is 90+ A, 80+ B, 70+ C, 60+ D, 59- F public void printOutput() { System.out.printf("Average of %d, %d, %d is %.2f Letter grade for %.2f is %s", score1, score2, score3, averageScore, averageScore, grade); } public static void main (String args[]) { Grader g = new Grader(); g.readInput(); g.computeAverageOfThreeScores(); g.computeLetterGrade(); g.printOutput(); } } 

Sample console I/O execution sequence

Enter 3 scores between 0 and 100 each: 80 60 57 Average of 80, 60, 57 is 65.67 Letter grade for 65.67 is D 

Write the computeAverageOfThreeScores method below.

Write the computeLetterGrade method below. Scale is 90+ A, 80+ B, 70+ C, 60+ D, 59- F

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

EXPLAIN the employers' responsibil it ies re ga rdin g harassme nt.

Answered: 1 week ago

Question

business management perspective in managerial accounting 2 answers

Answered: 1 week ago

Question

=+1 Is the decision fair to employees?

Answered: 1 week ago