-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGradeSystem.java
More file actions
59 lines (31 loc) · 1.11 KB
/
GradeSystem.java
File metadata and controls
59 lines (31 loc) · 1.11 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import java.util.Scanner;
public class GradeSystem{
public static void main (String [] args){
Scanner inputCollector = new Scanner (System.in);
System.out.println("Enter first number: ");
int firstNum = inputCollector.nextInt();
System.out.println("Enter second number: ");
int secondNum = inputCollector.nextInt();
System.out.println("Enter third number: ");
int thirdNum = inputCollector.nextInt();
int total = firstNum + secondNum + thirdNum;
int average = total/3;
int product = firstNum * secondNum * thirdNum;
int largest = total;
if (average > largest)
largest = average;
if (product > largest)
largest = product;
System.out.printf("The largest is %d%n", largest);
System.out.printf("The total and average of the three numbers are %d and %d respectively %n", total, average);
if (average >= 70){
System.out.println("Excellent");
System.out.println("Excellent!!!");}
else if (average >= 60){
System.out.println("Very Good");}
else if (average >= 45){
System.out.println("Good");}
else {
System.out.println("Needs Improvement");}
}
}