Answered You can hire a professional tutor to get the answer.

QUESTION

I need a method to determine based on the outputed average. I am showing 2 errors import java.

I need a method to determine based on the outputed average. I am showing 2 errors

import java.util.Scanner;

public class TestScoresTest{

 public static void main( String [] args ) {

  Scanner scanner = new Scanner( System.in );

  TestScores jeremy = new TestScores();

  double userScore1;

  double userScore2;

  double userScore3;

  double calculateAverage;

  char letterGrade;

  System.out.println( "Please enter score 1: " );

  userScore1 = scanner.nextDouble();

  System.out.println( "Please enter score 2: " );

  userScore2 = scanner.nextDouble();

  System.out.println( "Please enter score 3: " );

  userScore3 = scanner.nextDouble();

  jeremy.setScore1( userScore1 );

  jeremy.setScore2( userScore2 );

  jeremy.setScore3( userScore3 );

  System.out.printf( "The average of the %.2f, %.2f, and %.2f is %.2f",jeremy.getScore1(), jeremy.getScore2(), jeremy.getScore3(),

           jeremy.calculateAverage() );

  char letterGrade ( char letterGrade = calculateAverage );

{

  int calculateAverage;

  if (calculateAverage >= 90) {

    letterGrade = 'A';

  }

  else if (calculateAverage >= 80) {

    letterGrade = 'B';

  }

  else if (calculateAverage >= 70) {

    letterGrade = 'C';

  }

  else if (calculateAverage >= 60) {

    letterGrade = 'D';

  }

  else {

    letterGrade = 'F';

  }

  return letterGrade;

  }

 }

}

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question