-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrade.java
More file actions
44 lines (27 loc) · 1.01 KB
/
Grade.java
File metadata and controls
44 lines (27 loc) · 1.01 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
import java.util.Scanner;
public class Grade{
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.println("enter first score: ");
int Score1 = input.nextInt();
System.out.println ("enter second score : ");
int Score2 = input.nextInt();
System.out.println ("enter third score :");
int Score3 = input.nextInt();
System.out.println ("enter fourth score : ");
int Score4 = input.nextInt();
System.out.println ("enter fifth score : ");
int Score5 = input.nextInt();
// inttotal = (double)total /5.0;
double Total = Score1+Score2+Score3+Score4+Score5;
double average = Total / 5;
if(average >= 70 )
System.out.println ("Excellent");
if(average >= 60)
System.out.println("very good");
if(average >= 45)
System.out.println ("good");
else
System.out.println ("needs improvement");
}
}