My Java Percent Grade Calculator with keyboard input from user [code and file]

Need help in the world of technology? Here is the section for you, or talk about your favourite tech related topic, or what is new in the world of tech here.
Post Reply
User avatar
froggyboy604
Anime music gaming Fanatic
Posts: 37943
Joined: Thu Aug 18, 2005 11:28 pm
Contact:

My Java Percent Grade Calculator with keyboard input from user [code and file]

Post by froggyboy604 »

import java.util.Scanner;
import java.text.*;

public class GradeCalculator
{
public static void main (String [] args)
{

String output;

double Percentage;
String Grade;

Scanner input = new Scanner (System.in);

System.out.print( "\nPercent Grade Calculator\n\n\nInstructions\n=============\nEnter Percent you got" +
"on a course without the percent % sign Like 80\n\nYour Percent on Assignment: ");
Percentage = input.nextDouble();



//Income Tax


if (Percentage <= 100 && Percentage >=90)
{
Grade = "A";
}
else if (Percentage >=80 && Percentage <= 89)
{
Grade = "B";
}
else if (Percentage >= 70 && Percentage <=79)
{
Grade = "C";
}
else if (Percentage >= 50 && Percentage <=69)
{
Grade = "D";
}
else if (Percentage >=0 && Percentage <=49)
{
Grade = "F";
}
else
{
Grade=" Enter percent between 0-100";
}

System.out.println(Grade);


}
}

//Just a bunch of IF Else statements and user input Keyboard scanner. Compile and run in Jgrasp or MS-Dos
//I attach the Java file to this post . Unzip to your computer or it will not work. Enter just integer numbers
Post Reply