Write a java application program that takes in user input


Write a Java application program that takes in user input from keyboard and calculate semester grade based on the scores. In this assignment, you are going to rewrite the program, instead of taking keyboard input, you will use dialog box to prompt user, take input, and display result.

import java.util.Scanner;
public class examGrades

{

public static void main(String[] args)
{
//Scanner keyboard = new Scanner(System.in);
//double grades;
double exam;
double grade;//Grades input by user
String reply;
boolean moreGrades = true;

//System.out.print("Enter your score to find your grade");

while (moreGrades)
{
System.out.print("Please enter your exam score or press E to exit: \n");

//Scanner keyboard = new Scanner (System.in);
exam = keyboard.nextInt();
grade = exam;

if (grade >= 90 && grade <=100)
{
System.out.println("You received an A on your exam.");
}
else
if(grade >= 80 && grade < 90)
{
System.out.println("You received a B on your exam.");
}
else
if (grade >= 70 && grade < 80)
{
System.out.println("You recieved a C on your exam.");
}
else
if (grade >=60 && grade <70)
{
System.out.println("You received a D on your exam.");
}
else
if (grade < 60 && grade >=0)
{
System.out.println("You have received an F on your exam");
}
//else
//if (grade == 'E' || grade == 'e')
//{
// moreGrades = false;
//}
{

}

}

}

}

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a java application program that takes in user input
Reference No:- TGS01012991

Expected delivery within 24 Hours