-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTASK ONE
More file actions
59 lines (52 loc) · 957 Bytes
/
TASK ONE
File metadata and controls
59 lines (52 loc) · 957 Bytes
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
package task;
import java.util.Scanner;
public class tasktwo {
public static void main(String args[])
{
Scanner scan=new Scanner(System.in);
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.nextInt();
int d=scan.nextInt();
int e=scan.nextInt();
if(a<=100 && b<=100 && c<=100 && d<=100 && e<=100)
{
int total=a+b+c+d+e;
double avg=total/5;
System.out.println("Total marks = "+total);
System.out.println("Average percentage = "+avg+"%");
if(avg>=94)
{
System.out.print("Grade O");
}
else if(avg>=80)
{
System.out.print("Grade A++");
}
else if(avg>=70)
{
System.out.print("Grade A");
}
else if(avg>=60)
{
System.out.print("Grade B++");
}
else if(avg>50)
{
System.out.print("Grade B");
}
else if(avg==50)
{
System.out.print("Grade C");
}
else
{
System.out.print("Fail");
}
}
else
{
System.out.print("Enter mark below Hundred");
}
}
}