-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathepisode-6.java
50 lines (29 loc) · 1.22 KB
/
episode-6.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
int grade,sum =0, count = 0 ;
double avg;
System.out.println("Enter your grade number 1 ");
grade = in.nextInt();
while(grade != -1){
count++;
sum += grade;
System.out.println("enter your grade number" + (count +1));
grade = in.nextInt();
}
if(count !=0){
avg = (double)sum/count;
if( avg >=95){
System.out.println(" your average is great " + avg );
}else if (avg >=75 && avg<95){
System.out.println("your avg is ok");
}else{
System.out.println("your avg can to be batter");
}
System.out.println("your AVG is "+ avg);
System.out.println("your SUM is " + sum);
in.close();
}
}
}