Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't really understand how to make the scores show up and how to make it start over. I honestly only half understand the things

I don't really understand how to make the scores show up and how to make it start over. I honestly only half understand the things I've used to piece this together to make this work so far. but this is what I was asked to do.....

  1. read a user's first and last name
  2. read three integer scores, calculate the total and average
  3. determine the letter grade based on the following criteria - Average 90-100 grade is A, 80-89.99 grade is B, 70-79.99 grade is C, all others F (use a nested if)
  4. Output formatted results consisting of the full name, the three scores, the total, average (to 2 decimal places), and the letter grade
  5. go to step 1 if user wants to go through the above 4 steps for another student
  6. I am required to use a method for each of the steps 1-4, and required to use a while loop and a nested if in the program in addition to working with methods

and this is what I have so far.......

package speakmanassignment2;

import java.util.*;

public class SpeakmanAssignment2 { public static void main(String[] args) { // First & Last Names String FirstName = getFirstName(); String LastName = getLastName(); Scanner sc = new Scanner(System.in); int score[]=new int[3]; //Score input System.out.println("First Score:"); score[0]=sc.nextInt(); System.out.println("Second Score"); score[1]=sc.nextInt(); System.out.println("Third Score"); score[2]=sc.nextInt(); //Total int total= getTotal(score); //Average float average = (float)total/3; //Calculate grade char grade = getGrade(average); //Output System.out.println("Full name "+FirstName+" "+LastName); System.out.println("Score 1: %f, Score2:f, Score3:f, "); System.out.println("Total %.2f"+total); System.out.printf("Average %.2f ",average); System.out.println(" Grade "+grade); } //Return first name public static String getFirstName(){ Scanner sc = new Scanner(System.in); System.out.println("Enter First Name "); String name = sc.next(); return name; } //Return last name public static String getLastName(){ Scanner sc = new Scanner(System.in); System.out.println("Enter Last Name "); String name = sc.next(); return name; } //Return scores {

} //Return total score public static int getTotal(int a[]){ int total=0; for(int i=0;i=90.00 && average<=100.00) return 'A'; else if(average>=80.00&&average<=89.99) return 'B'; else if(average>=70.00&&average<=79.99) return 'C'; else return 'F'; }

}

------END------

Any help with this would really be appreciated cause I'm really lost.

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 1 Lnai 9284

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Carlos Soares ,Joao Gama ,Alipio Jorge

1st Edition

3319235273, 978-3319235271

More Books

Students also viewed these Databases questions

Question

Determine the amplitude and period of each function.

Answered: 1 week ago

Question

Using Language That Works

Answered: 1 week ago

Question

4. Are my sources relevant?

Answered: 1 week ago