forked from Denisolt/CSCI-160
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestAverage.java
More file actions
37 lines (30 loc) · 1.19 KB
/
TestAverage.java
File metadata and controls
37 lines (30 loc) · 1.19 KB
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
32
33
34
35
36
37
//Deni Shakhbulatov
//09.17.2015
import java.util.Scanner;
public class TestAverage
{
public static void main(String[] args)
{
double score1;
Scanner keyboard = new Scanner(System.in);
System.out.print("Enter test score 1: ");
score1 = keyboard.nextDouble();
double score2;
System.out.print("Enter test score 2: ");
score2 = keyboard.nextDouble();
double score3;
System.out.print("Enter test score 3: ");
score3 = keyboard.nextDouble();
double TestAve = (score1 + score2 + score3) / 3;
if (TestAve < 60)
System.out.println("Your test average is " + TestAve + " and your grade is F.");
else if (TestAve <= 69)
System.out.println("Your test average is " + TestAve + " and your grade is D.");
else if (TestAve <= 79)
System.out.println("Your test average is " + TestAve + " and your grade is C.");
else if (TestAve <= 89)
System.out.println("Your test average is " + TestAve + " and your grade is B.");
else if (TestAve <= 100)
System.out.println("Your test average is " + TestAve + " and your grade is A.");
}
}