my code is supposed to calculate quiz 10% pratical 50 %, exam, and midterm 40 % and output overall average and quivalent letter grade.
import javax.swing.*; import java.text.*; public class c6gradecalculation { private double q1; private double pa; private double mid; private double fin; private double q1score; private double pascore; private double midscore; private double finscore; private double overallscore; public String grade; public String myLetterGrade() { String grade =""; if (overallscore <60) grade = "F"; else if (overallscore >=60 && overallscore < 70) grade = "D"; else if (overallscore >=70 && overallscore < 80) grade = "C"; else if (overallscore >=80 && overallscore < 90) grade = "B"; else if (overallscore >=90 && overallscore <=100) grade = "A"; return grade; } public double getScore() { q1 = Double.parseDouble(JOptionPane.showInputDialog("Enter Quiz Score (0-100)")); pa = Double.parseDouble(JOptionPane.showInputDialog("Enter Pratical Average Score (0-100)")); mid = Double.parseDouble(JOptionPane.showInputDialog("Enter Midterm Exam Score (0-100)")); fin = Double.parseDouble(JOptionPane.showInputDialog("Enter Finals Exam Score (0-100)")); q1score = q1 * 0.10; pascore = pa * 0.50; midscore = mid * 0.20; finscore = fin * 0.20; overallscore = (q1score + pascore + midscore + finscore); return overallscore;