-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdmissionMain.java
89 lines (61 loc) · 1.85 KB
/
AdmissionMain.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import java.util.Scanner;
class Admission
{
Scanner obj=new Scanner(System.in);
//Declaration of variable
String name;
int hin,eng,math,sci,bio;
float percent,sum;
void input()
{
System.out.println("Enter your name");
name=obj.nextLine();
System.out.println("Enter obtained marks in Hindi");
hin=obj.nextInt();
System.out.println("Enter obtained marks in English");
eng=obj.nextInt();
System.out.println("Enter obtained marks in Mathematics");
math=obj.nextInt();
System.out.println("Enter obtained marks in Science");
sci=obj.nextInt();
System.out.println("Enter obtained marks in Biology");
bio=obj.nextInt();
}
void process()
{
if(hin>100||eng>100||math>100||sci>100||bio>100)
System.out.println("You have entered invalid marks");
else if(hin<45||eng<45||math<45||sci<45||bio<45)
System.out.println("you are not illegible");
sum=hin+eng+math+sci+bio;
System.out.println("Total marks="+" "+sum);
percent=sum/500*100;
System.out.println("Total percenatage="+" "+percent+"%");
}
void meritlist()
{
if(percent>=80)
System.out.println("Your name in meritlist 1");
else if(percent<80&&percent>=60)
System.out.println("Your name in meritlist 2");
else
System.out.println("Your name in meritlist 3");
}
}
class AdmissionMain
{
public static void main(String args[])
{
Admission obj=new Admission();
Scanner admi=new Scanner(System.in);
int ch;
do
{
obj.input();
obj.process();
obj.meritlist();
System.out.println("Press 0 to continue or any other key to exit");
ch=admi.nextInt();
}while(ch==0);
}
}