Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Declare a String variable to store the user's name and a double to store their grade entered from the keyboard. Modify the main method to

  1. Declare a String variable to store the user's name and a double to store their grade entered from the keyboard. Modify the main method to have the program displays their name in the output.
  2. Your changes will only be made in the main method.
  3. The output would look like this:
    • Hello, please tell me your first name: Grace Grace, please enter your percentage: 62.3 Grace, a 62.3 is a Dimage text in transcribed
public class TestVoidMethod { public static void main(String[] args) { System.out.print("The grade is "); printGrade (78.5); System.out.print("The grade is "); printGrade (59.5); 9 10 11 public static void printGrade (double score) { if (score >= 90.0) { System.out.println('A'); 12 73 14 else if (score >= 80.0) { System.out.println('B'); 15 16 17 else if (score >= 70.0) { System.out.println('C'); 18 19 20 else if (score >= 60.0) { System.out.println('D'); 21 22 23 24 else { System.out.println('F'); } 25 26 27 } } The grade is C The grade is 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

Step: 3

blur-text-image

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

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions