-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
testtt.java
31 lines (31 loc) · 938 Bytes
/
testtt.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* make an grade calculator that takes in the grade and the weight of the grade
* and then calculates the final grade
* use grading system A,B,C,D,F
*/
import java.util.Scanner;
public class testtt {
public static void main (String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter the grade and the weight of the grade");
double grade = input.nextDouble();
double weight = input.nextDouble();
double finalGrade = grade * weight;
System.out.println("The final grade is " + finalGrade);
if (finalGrade >= 90) {
System.out.println("The grade is A");
}
else if (finalGrade >= 80) {
System.out.println("The grade is B");
}
else if (finalGrade >= 70) {
System.out.println("The grade is C");
}
else if (finalGrade >= 60) {
System.out.println("The grade is D");
}
else {
System.out.println("The grade is F");
}
}
}