//reorder the following code and plug it on the above main method.execute and ru
ID: 3528970 • Letter: #
Question
//reorder the following code and plug it on the above main method.execute and run the program on jgrasp for the three scores(70,80,90) import javax.swingJOptionPane; public class yourName { public static void main(String[] args) { else if (Average > 69 LetterGrade="c"; else if (Average>79) LetterGrade="B"; if (Average>89) LetterGrade="A"; input=JOptionPane.showInputDialog("70"); JOptionPane.showMessageDialog(null,"The score is"+LetterGrade); score1=Double.parseDouble(A); input=JOptionPane.showInputDialog("80"); input=JOptionPane.showInputDialog("90"); score2=Double.parseDouble(B); score3=Double.parseDouble(C); Average=(score1 + score2 + score3)/3; String input, LetterGrade; double score1, score2, score3, Average; else LetterGrade="F"; else if (Average>59)LetterGrade="D" } }Explanation / Answer
import javax.swing.JOptionPane;
public class yourName {
public static void main(String[] args) {
String input, LetterGrade; double score1, score2, score3, Average;
input=JOptionPane.showInputDialog("90");
score1=Double.parseDouble(A);
input=JOptionPane.showInputDialog("80");
score2=Double.parseDouble(B);
input=JOptionPane.showInputDialog("70");
score3=Double.parseDouble(C);
Average=(score1 + score2 + score3)/3;
if (Average>89) LetterGrade="A";
else if (Average>79) LetterGrade="B";
else if (Average > 69) LetterGrade="c";
else if (Average>59)LetterGrade="D"
else LetterGrade="F";
JOptionPane.showMessageDialog(null,"The score is"+LetterGrade);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.