my problem is i cant get the overall numeric score and the grade letter
import java.io.*;
import java.util.Scanner;
public class GradePrg {
BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
int quiz1, quiz2, quiz3;
float tMidTerm, tFinal, tQuiz;
int midTermExam = 0;
int finalExam = 0;
float finalScore= 0;
String name;
char grade;
//Method: get Student Name
public void getName()
{
System.out.println("Students calculated final scores");
System.out.println("and letter grades. ");
System.out.println("Please enter your name. ");
Scanner in = new Scanner(System.in);
name = in.nextLine();
}
//Method: get grades
public void getGrades() throws Exception
{
System.out.println("Please enter your first quiz number :");
Scanner in = new Scanner(System.in);
quiz1 = in.nextInt();
System.out.println("Please enter your second quiz number. ");
quiz2 = in.nextInt();
System.out.println("Please enter your third quiz number. ");
quiz3 = in.nextInt();
System.out.println("Please enter your mid term exam number ");
midTermExam = in.nextInt();
System.out.println("Please enter your Final exam number ");
finalExam= in.nextInt();
}
//Method: Calculate Score
public void getScore()
{
tQuiz = (((quiz1 + quiz2 + quiz3)/30)* 25);
tMidTerm = ((midTermExam/100)*25);
tFinal = ((finalExam/100)*50);
}
public void getFinalScore()
{
finalScore = tQuiz + tMidTerm + tFinal;
}
//Method: get letter grade
public void getLetterGrade(){
if (finalScore >= 90)
{
grade = 'A';
}
if (finalScore >= 80)
{
grade = 'B';
}
if (finalScore >= 70)
{
grade = 'C';
}
if (finalScore >= 60)
{
grade = 'D';
}
System.out.println( "Student name: " + name );
System.out.println( "First quiz score: " + quiz1 );
System.out.println( "Second quiz score: " + quiz2 );
System.out.println( "Third quiz score: " + quiz3 );
System.out.println( "Midterm Exam score: " + midTermExam );
System.out.println( "Final Exam score: " + finalExam );
System.out.println( "Your final grade is: " + grade );
}
}
import java.io.*;
public class GradePrgTester
{
public static void main(String args[]) throws Exception
{
GradePrg quiz =new GradePrg();
quiz.getName();
quiz.getGrades();
quiz.getScore();
quiz.getLetterGrade();
}
}