Write a program by using the following code to accept three input scores and dis
ID: 3911237 • Letter: W
Question
Write a program by using the following code to accept three input scores and display to output the average. Note: use java swing import feature Part I import javax.swing. JOptionPane; public class Your name public static void main (String[] args) type your code here Help Reorder the following codes and plug on the above program compile, run, and submit the screenshot and .java file for credit Correct code, compiled, run, screenshot, and .java file you get 30 points else if (Average 69) LetterGrd-"C; else if (Average-79) Lette rGrd-"B"; if (Average>89) LetterGrd-"A"; input JOptionPane.showlnputDialog("Enter First Score1"); OptionPane.showMessageDialog(nul, "The score is "+LetterGrd); score1 Double.parseDouble(input); input JOptionPane.showlnputDialog("Enter First Score2"); input JOption Pane.showlnputDialog( Enter First Score3"); score2 Double.parseDouble (input) score3 Double.parseDouble (input); Average -(score1+score2+score3)/3; String input, LetterGrd; double score1,score2, score3,Average; else LetterGrd-"F"; else if (Average>59) LetterGrd-D;Explanation / Answer
CODE IN JAVA AFTER REORDER THE LINES:
import javax.swingJOptionPane;
public class Your_name {
public static void main(Stringa args[]){
double score1,score2,score3,Average;
String inpu,LetterGrd;
input = JOptionPane.showInputDialog("Enter First Score1");
Score1 = Double.parseDouble(input);
input = JOptionPane.showInputDialog("Enter First Score2");
Score2 = Double.parseDouble(input);
input = JOptionPane.showInputDialog("Enter First Score3");
Score3 = Double.parseDouble(input);
Average = (score1+score2+score3)/3;
if(Average>89) LetterGrd='A';
else if(Average>79) LetterGrd='B';
else if(Average>69) LetterGrd='C';
else if(Average>59) LetterGrd='D';
else LetterGrd='F';
JOptionPane.showMessageDialog(null,"The score is "+LetterGrd);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.