I am working on a program that needs to allow a teacher to put in grades for an exam but I need it to ask for more then one student if the question of How many students? is greater then 1 then it needs to ask for the students first name, last name, and score,
Then it needs to calculate the score and give it a letter grade
This is my code so far
import javax.swing.JOptionPane;
public class Project { public static void main(String[] args) { double Score = 0; char LetterGrade = 0; String strMessage; JOptionPane.showInputDialog("Please enter the total possible points for the test"); JOptionPane.showInputDialog("How many students do you have to enter"); JOptionPane.showInputDialog("Please enter students first name"); JOptionPane.showInputDialog("Please enter students last name"); JOptionPane.showInputDialog("Please enter students test score"); if(Score<=90) LetterGrade='A'; else if (Score<=80) LetterGrade='B'; else if (Score<=70) LetterGrade='C'; else if (Score<=60) LetterGrade='D'; else LetterGrade='F'; strMessage=String.format("Your score of %.2f has earned you a letter grade of %c", Score,LetterGrade); JOptionPane.showMessageDialog(null, strMessage); } }