-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRank.java
1234 lines (1057 loc) · 45.5 KB
/
Rank.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import java.util.*;
public class Rank {
//for calculating percentage
public static float calculatePercentage(float a, float b) {
float per = (a / b) * 100;
return per;
}
//for counting
public static int countDigit(long EN) {
int count = 0;
while (EN > 0) {
EN /= 10;
count++;
}
return count;
}
//to store ssc details
public class SSCDetails {
private float eng;
private float maths;
private float science;
private float ss;
private float hindi;
private float marathi;
private float total;
public float getEng() {
return eng;
}
public void setEng(float eng) {
this.eng = eng;
}
public float getMaths() {
return maths;
}
public void setMaths(float maths) {
this.maths = maths;
}
public float getScience() {
return science;
}
public void setScience(float science) {
this.science = science;
}
public float getSs() {
return ss;
}
public void setSs(float ss) {
this.ss = ss;
}
public float getHindi() {
return hindi;
}
public void setHindi(float hindi) {
this.hindi = hindi;
}
public float getMarathi() {
return marathi;
}
public void setMarathi(float marathi) {
this.marathi = marathi;
}
public float getTotal() {
return total;
}
public void setTotal(float total) {
this.total = total;
}
}
//to store hsc details
public class HSCDetails {
private float eng;
private float physics;
private float chemistry;
private float maths;
private float vocational;
private float total;
public float getEng() {
return eng;
}
public void setEng(float eng) {
this.eng = eng;
}
public float getPhysics() {
return physics;
}
public void setPhysics(float physics) {
this.physics = physics;
}
public float getChemistry() {
return chemistry;
}
public void setChemistry(float chemistry) {
this.chemistry = chemistry;
}
public float getMaths() {
return maths;
}
public void setMaths(float maths) {
this.maths = maths;
}
public float getVocational() {
return vocational;
}
public void setVocational(float vocational) {
this.vocational = vocational;
}
public float getTotal() {
return total;
}
public void setTotal(float total) {
this.total = total;
}
}
//to store mhtcet details
public class MHTCETDetails {
private float physics;
private float chemistry;
private float maths;
private float total;
public float getPhysics() {
return physics;
}
public void setPhysics(float physics) {
this.physics = physics;
}
public float getChemistry() {
return chemistry;
}
public void setChemistry(float chemistry) {
this.chemistry = chemistry;
}
public float getMaths() {
return maths;
}
public void setMaths(float maths) {
this.maths = maths;
}
public float getTotal() {
return total;
}
public void setTotal(float total) {
this.total = total;
}
}
//to store DOB
public class DOB {
private int day;
private int month;
private int year;
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
public int getMonth() {
return month;
}
public void setMonth(int month) {
this.month = month;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
}
//to store percentile
public class MHTCETPercentileDetails {
private double physics;
private double chemistry;
private double maths;
private double total;
public double getPhysics() {
return physics;
}
public void setPhysics(double physics) {
this.physics = physics;
}
public double getChemistry() {
return chemistry;
}
public void setChemistry(double chemistry) {
this.chemistry = chemistry;
}
public double getMaths() {
return maths;
}
public void setMaths(double maths) {
this.maths = maths;
}
public double getTotal() {
return total;
}
public void setTotal(double total) {
this.total = total;
}
}
//to store details of student
public class Detail {
private long EN;
private long ph;
private String name;
private String email;
private String category;
private String gender;
private String pwd_def;
private String ews;
private String tfws;
private String orphan;
private String minority;
private SSCDetails ssc;
private float ssc_per;
private HSCDetails hsc;
private float hsc_per;
private float hsc_pcm;
private MHTCETDetails mhtcet;
private DOB dob;
private MHTCETPercentileDetails per;
private int no; // Test purpose
public long getEN() {
return EN;
}
public void setEN(long eN) {
EN = eN;
}
public long getPh() {
return ph;
}
public void setPh(long ph) {
this.ph = ph;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getPwdDef() {
return pwd_def;
}
public void setPwdDef(String pwd_def) {
this.pwd_def = pwd_def;
}
public String getEws() {
return ews;
}
public void setEws(String ews) {
this.ews = ews;
}
public String getTfws() {
return tfws;
}
public void setTfws(String tfws) {
this.tfws = tfws;
}
public String getOrphan() {
return orphan;
}
public void setOrphan(String orphan) {
this.orphan = orphan;
}
public String getMinority() {
return minority;
}
public void setMinority(String minority) {
this.minority = minority;
}
public SSCDetails getSsc() {
return ssc;
}
public void setSsc(SSCDetails ssc) {
this.ssc = ssc;
}
public float getSsc_per() {
return ssc_per;
}
public void setSsc_per(float ssc_per) {
this.ssc_per = ssc_per;
}
public HSCDetails getHsc() {
return hsc;
}
public void setHsc(HSCDetails hsc) {
this.hsc = hsc;
}
public float getHsc_per() {
return hsc_per;
}
public void setHsc_per(float hsc_per) {
this.hsc_per = hsc_per;
}
public float getHsc_pcm() {
return hsc_pcm;
}
public void setHsc_pcm(float hsc_pcm) {
this.hsc_pcm = hsc_pcm;
}
public MHTCETDetails getMhtcet() {
return mhtcet;
}
public void setMhtcet(MHTCETDetails mhtcet) {
this.mhtcet = mhtcet;
}
public DOB getDob() {
return dob;
}
public void setDob(DOB dob) {
this.dob = dob;
}
public MHTCETPercentileDetails getPer() {
return per;
}
public void setPer(MHTCETPercentileDetails per) {
this.per = per;
}
public int getNo() {
return no;
}
public void setNo(int no) {
this.no = no;
}
public String getPwd_def() {
return pwd_def;
}
public void setPwd_def(String pwd_def) {
this.pwd_def = pwd_def;
}
}
//to sort and assign Total Percentile
public static void sortAndAssignTotalPercentile(Detail[] stud) {
int n = stud.length;
// Sorting according to total marks
Detail tempT;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (stud[j].getMhtcet().getTotal() < stud[j + 1].getMhtcet().getTotal()) {
tempT = stud[j];
stud[j] = stud[j + 1];
stud[j + 1] = tempT;
}
}
}
// Assigning Percentile for Total
for (int i = 0; i < n; i++) {
if (i < n - 1 && stud[i].getMhtcet().getTotal() == stud[i + 1].getMhtcet().getTotal()) {
stud[i].getPer().setTotal(((double) (n - i) / (double) n) * 100);
stud[i + 1].getPer().setTotal(((double) (n - i) / (double) n) * 100);
i++;
} else {
stud[i].getPer().setTotal(((double) (n - i) / (double) n) * 100);
}
}
}
//to sort and assign Maths Percentile
public static void sortAndAssignMathsPercentile(Detail[] stud) {
int n = stud.length;
// Sorting according to maths marks
Detail tempM;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (stud[j].getMhtcet().getMaths() < stud[j + 1].getMhtcet().getMaths()) {
tempM = stud[j];
stud[j] = stud[j + 1];
stud[j + 1] = tempM;
}
}
}
// Assigning Percentile for maths
for (int i = 0; i < n; i++) {
if (i < n - 1 && stud[i].getMhtcet().getMaths() == stud[i + 1].getMhtcet().getMaths()) {
stud[i].getPer().setMaths(((double) (n - i) / (double) n) * 100);
stud[i + 1].getPer().setMaths(((double) (n - i) / (double) n) * 100);
i++;
} else {
stud[i].getPer().setMaths(((double) (n - i) / (double) n) * 100);
}
}
}
//to sort and assign Physics Percentile
public static void sortAndAssignPhysicsPercentile(Detail[] stud) {
int n = stud.length;
// Sorting according to Physics marks
Detail tempP;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (stud[j].getMhtcet().getPhysics() < stud[j + 1].getMhtcet().getPhysics()) {
tempP = stud[j];
stud[j] = stud[j + 1];
stud[j + 1] = tempP;
}
}
}
// Assigning Percentile for Physics
for (int i = 0; i < n; i++) {
if (i < n - 1 && stud[i].getMhtcet().getPhysics() == stud[i + 1].getMhtcet().getPhysics()) {
stud[i].getPer().setPhysics(((double) (n - i) / (double) n) * 100);
stud[i + 1].getPer().setPhysics(((double) (n - i) / (double) n) * 100);
i++;
} else {
stud[i].getPer().setPhysics(((double) (n - i) / (double) n) * 100);
}
}
}
//to sort and assign Chemistry Percentile
public static void sortAndAssignChemistryPercentile(Detail[] stud) {
int n = stud.length;
// Sorting according to Chemistry marks
Detail tempC;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (stud[j].getMhtcet().getChemistry() < stud[j + 1].getMhtcet().getChemistry()) {
tempC = stud[j];
stud[j] = stud[j + 1];
stud[j + 1] = tempC;
}
}
}
// Assigning Percentile for Chemistry
for (int i = 0; i < n; i++) {
if (i < n - 1 && stud[i].getMhtcet().getChemistry() == stud[i + 1].getMhtcet().getChemistry()) {
stud[i].getPer().setChemistry(((double) (n - i) / (double) n) * 100);
stud[i + 1].getPer().setChemistry(((double) (n - i) / (double) n) * 100);
i++;
} else {
stud[i].getPer().setChemistry(((double) (n - i) / (double) n) * 100);
}
}
}
public static void sortByMathsPercentile(int a, int b, Detail[] stud) {
// Sorting according to Maths Percentile
Detail tempPerM;
if (stud[a].getPer().getMaths() < stud[b].getPer().getMaths()) {
tempPerM = stud[a];
stud[a] = stud[b];
stud[b] = tempPerM;
}
}
public static void sortByPhysicsPercentile(int a, int b, Detail[] stud) {
// Sorting according to Physics Percentile
Detail tempPerP;
if (stud[a].getPer().getPhysics() < stud[b].getPer().getPhysics()) {
tempPerP = stud[a];
stud[a] = stud[b];
stud[b] = tempPerP;
}
}
public static void sortByChemistryPercentile(int a, int b, Detail[] stud) {
// Sorting according to Chemistry Percentile
Detail tempPerC;
if (stud[a].getPer().getChemistry() < stud[b].getPer().getChemistry()) {
tempPerC = stud[a];
stud[a] = stud[b];
stud[b] = tempPerC;
}
}
//to sort according to HSC PCM
public static void sortByPCM(int a, int b, Detail[] stud) {
// Sorting according to HSC PCM marks
Detail tempPCM;
if (stud[a].getHsc_pcm() < stud[b].getHsc_pcm()) {
tempPCM = stud[a];
stud[a] = stud[b];
stud[b] = tempPCM;
}
}
//to sort according to HSC Maths
public static void sortHscMaths(int a, int b, Detail[] stud) {
// Sorting according to HSC Maths marks
Detail tempHscMaths;
if (stud[a].getHsc().getMaths() < stud[b].getHsc().getMaths()) {
tempHscMaths = stud[a];
stud[a] = stud[b];
stud[b] = tempHscMaths;
}
}
//to sort according to HSC Physics
public static void sortHscPhysics(int a, int b, Detail[] stud) {
// Sorting according to HSC Physics marks
Detail tempHscPhysics;
if (stud[a].getHsc().getPhysics() < stud[b].getHsc().getPhysics()) {
tempHscPhysics = stud[a];
stud[a] = stud[b];
stud[b] = tempHscPhysics;
}
}
//to sort according to HSC Total
public static void sortHscTotal(int a, int b, Detail[] stud) {
// Sorting according to HSC Total marks
Detail tempHscTotal;
if (stud[a].getHsc().getTotal() < stud[b].getHsc().getTotal()) {
tempHscTotal = stud[a];
stud[a] = stud[b];
stud[b] = tempHscTotal;
}
}
//to sort according to SSC Total
public static void sortSscTotal(int a, int b, Detail[] stud) {
// Sorting according to SSC Total marks
Detail tempSscTotal;
if (stud[a].getSsc().getTotal() < stud[b].getSsc().getTotal()) {
tempSscTotal = stud[a];
stud[a] = stud[b];
stud[b] = tempSscTotal;
}
}
//to sort according to SSC Maths Marks
public static void sortSscMaths(int a, int b, Detail[] stud) {
// Sorting according to SSC Maths marks
Detail tempSscMaths;
if (stud[a].getSsc().getMaths() < stud[b].getSsc().getMaths()) {
tempSscMaths = stud[a];
stud[a] = stud[b];
stud[b] = tempSscMaths;
}
}
//to sort according to SSC Science Marks
public static void sortSscScience(int a, int b, Detail[] stud) {
// Sorting according to SSC Science marks
Detail tempSscScience;
if (stud[a].getSsc().getScience() < stud[b].getSsc().getScience()) {
tempSscScience = stud[a];
stud[a] = stud[b];
stud[b] = tempSscScience;
}
}
//to sort according to SSC English Marks
public static void sortSscEnglish(int a, int b, Detail[] stud) {
// Sorting according to SSC English marks
Detail tempSscEnglish;
if (stud[a].getSsc().getEng() < stud[b].getSsc().getEng()) {
tempSscEnglish = stud[a];
stud[a] = stud[b];
stud[b] = tempSscEnglish;
}
}
//to sort according to Year
public static void sortYear(int a, int b, Detail[] stud) {
// Sorting according to year of birth
Detail tempDobYear;
if (stud[a].getDob().getYear() < stud[b].getDob().getYear()) {
tempDobYear = stud[a];
stud[a] = stud[b];
stud[b] = tempDobYear;
}
}
//to sort according to Month
public static void sortMonth(int a, int b, Detail[] stud) {
// Sorting according to month of birth
Detail tempDobMonth;
if (stud[a].getDob().getMonth() < stud[b].getDob().getMonth()) {
tempDobMonth = stud[a];
stud[a] = stud[b];
stud[b] = tempDobMonth;
}
}
//to sort according to Day
public static void sortDay(int a, int b, Detail[] stud) {
// Sorting according to day of birth
Detail tempDobDay;
if (stud[a].getDob().getDay() < stud[b].getDob().getDay()) {
tempDobDay = stud[a];
stud[a] = stud[b];
stud[b] = tempDobDay;
}
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Rank rank = new Rank();
System.out.println("\n---------------- WELCOME TO MHT-CET JAVA PROGRAM ----------------");
System.out.print("\nEnter the Number of Students: ");
int n = scanner.nextInt();
Detail[] s = new Detail[n];
float[] ssc_arr = new float[6];
float min;
System.out.println("\nEnter the Details of " + n + " Student(s): ");
for(int i=0; i<n; i++){
int ssctotal=0, c=0;
s[i]= rank.new Detail();
s[i].ssc = rank.new SSCDetails(); // Initialize the SSCDetails object for the student
s[i].hsc = rank.new HSCDetails(); // Initialize the HSCDetails object for the student
s[i].mhtcet = rank.new MHTCETDetails(); // Initialize the MHT-CET object for the student
s[i].dob = rank.new DOB(); // Initialize the MHT-CET object for the student
s[i].per = rank.new MHTCETPercentileDetails(); // Initialize the MHTCETPercentileDetails object for the student
while(true){
System.out.print("\n------------ Student " + (i+1) + "/" + n + " ------------\n\n");
System.out.print("EN Number (EN12345678): EN");
s[i].EN = scanner.nextLong();
scanner.nextLine();
if(countDigit(s[i].EN)==8){
System.out.println("\nI. Personal Details");
System.out.print("1. Name (Surename_Name_Lastname): ");
s[i].name = scanner.nextLine();
while(true){
System.out.print("2. Contact Number: ");
long ph = scanner.nextLong();
if(countDigit(ph)==10){
s[i].ph=ph;
scanner.nextLine();
System.out.print("3. Email: ");
s[i].email= scanner.nextLine();
char A;
do{
System.out.println("\n a. Open b. SC c. ST d. OBC e. SBC");
System.out.print("4. Category: ");
A = scanner.next().charAt(0);
scanner.nextLine();
switch(A){
case 'a':
s[i].category="Open";
break;
case 'b':
s[i].category="SC";
break;
case 'c':
s[i].category="ST";
break;
case 'd':
s[i].category="OBC";
break;
case 'e':
s[i].category="SBC";
break;
default:
System.out.println("!!! Invaid Input, Try Again !!!");
}
}while(A!='a' && A!='b' && A!='c' && A!='d' && A!='e');
System.out.println(" "+s[i].category);
char B;
do{
System.out.println("\n a. Male b. Female c. Other");
System.out.print("5. Gender: ");
B = scanner.next().charAt(0);
scanner.nextLine();
switch(B){
case 'a':
s[i].gender="Male";
break;
case 'b':
s[i].gender="Female";
break;
case 'c':
s[i].gender="Other";
break;
default:
System.out.println("!!! Invaid Input, Try Again !!!");
}
}while(B!='a' && B!='b' && B!='c');
System.out.println(" "+s[i].gender);
char C;
do{
System.out.println("\n y. Yes n. No");
System.out.print("6. PWD/DEF: ");
C = scanner.next().charAt(0);
scanner.nextLine();
switch(C){
case 'y':
s[i].pwd_def="Yes";
break;
case 'n':
s[i].pwd_def="No";
break;
default:
System.out.println("!!! Invaid Input, Try Again !!!");
}
}while(C!='y' && C!='n');
System.out.println(" "+s[i].pwd_def);
char D;
do{
System.out.println("\n y. Yes n. No");
System.out.print("7. EWS: ");
D = scanner.next().charAt(0);
scanner.nextLine();
switch(D){
case 'y':
s[i].ews="Yes";
break;
case 'n':
s[i].ews="No";
break;
default:
System.out.println("!!! Invaid Input, Try Again !!!");
}
}while(D!='y' && D!='n');
System.out.println(" "+s[i].ews);
if(s[i].ews == "Yes"){
System.out.println("\n8. TFWS:Not Elligible");
}
else{
char E;
do{
System.out.println("\n y. Yes n. No");
System.out.print("8. TFWS: ");
E = scanner.next().charAt(0);
scanner.nextLine();
switch(E){
case 'y':
s[i].tfws="Yes";
break;
case 'n':
s[i].tfws="No";
break;
default:
System.out.println("!!! Invaid Input, Try Again !!!");
}
}while(E!='y' && E!='n');
System.out.println(" "+s[i].tfws);
}
char F;
do{
System.out.println("\n y. Yes n. No");
System.out.print("9. Orphan: ");
F = scanner.next().charAt(0);
scanner.nextLine();
switch(F){
case 'y':
s[i].orphan="Yes";
break;
case 'n':
s[i].orphan="No";
break;
default:
System.out.println("!!! Invaid Input, Try Again !!!");
}
}while(F!='y' && F!='n');
System.out.println(" "+s[i].orphan);
char G;
do{
System.out.println("\n r. Religious Minority l. Liguistic Minority n. None");
System.out.print("10. Minority: ");
G = scanner.next().charAt(0);
scanner.nextLine();
switch(G){
case 'r':
s[i].minority="Religious Minority";
break;
case 'l':
s[i].minority="Linguistic Minority";
break;
case 'n':
s[i].minority="None";
break;
default:
System.out.println("!!! Invaid Input, Try Again !!!");
}
}while(G!='r' && G!='l' && G!='n');
System.out.println(" "+s[i].minority);
//TAKING DETAILS OF SSC MARKS
System.out.println("\nII. SSC Marks");
do{
System.out.print("1. English: ");
s[i].ssc.eng = scanner.nextFloat();
ssc_arr[0]=s[i].ssc.eng;
if((s[i].ssc.eng<0) || (s[i].ssc.eng>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].ssc.eng<0) || (s[i].ssc.eng>100));
do{
System.out.print("2. Maths: ");
s[i].ssc.maths = scanner.nextFloat();
ssc_arr[1]=s[i].ssc.maths;
if((s[i].ssc.maths<0) || (s[i].ssc.maths>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].ssc.maths<0) || (s[i].ssc.maths>100));
do{
System.out.print("3. Science: ");
s[i].ssc.science = scanner.nextFloat();
ssc_arr[2]=s[i].ssc.science;
if((s[i].ssc.science<0) || (s[i].ssc.science>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].ssc.science<0) || (s[i].ssc.science>100));
do{
System.out.print("4. Social Studies: ");
s[i].ssc.ss = scanner.nextFloat();
ssc_arr[3]=s[i].ssc.ss;
if((s[i].ssc.ss<0) || (s[i].ssc.ss>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].ssc.ss<0) || (s[i].ssc.ss>100));
do{
System.out.print("5. Hindi: ");
s[i].ssc.hindi = scanner.nextFloat();
ssc_arr[4]=s[i].ssc.hindi;
if((s[i].ssc.hindi<0) || (s[i].ssc.hindi>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].ssc.hindi<0) || (s[i].ssc.hindi>100));
do{
System.out.print("6. Marathi: ");
s[i].ssc.marathi = scanner.nextFloat();
ssc_arr[5]=s[i].ssc.marathi;
if((s[i].ssc.marathi<0) || (s[i].ssc.marathi>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].ssc.marathi<0) || (s[i].ssc.marathi>100));
min=ssc_arr[0];
for(int j=0; j<6; j++){
if(ssc_arr[j]<min){
min=ssc_arr[j];
c=j;
}
}
ssc_arr[c]=0;
for(int j=0; j<6; j++){
ssctotal+=ssc_arr[j];
}
s[i].ssc.total=ssctotal;
System.out.println("7. Total (Best of 5 ): "+s[i].ssc.total);
s[i].ssc_per = calculatePercentage((s[i].ssc.total), 500);
System.out.println("8. Percentage: "+s[i].ssc_per);
//TAKING DETAILS OF HSC MARKS
System.out.println("\nIII. HSC Marks");
do{
System.out.print("1. English: ");
s[i].hsc.eng = scanner.nextFloat();
if((s[i].hsc.eng<0) || (s[i].hsc.eng>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].hsc.eng<0) || (s[i].hsc.eng>100));
do{
System.out.print("2. Physics: ");
s[i].hsc.physics = scanner.nextFloat();
if((s[i].hsc.physics<0) || (s[i].hsc.physics>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].hsc.physics<0) || (s[i].hsc.physics>100));
do{
System.out.print("3. Chemistry: ");
s[i].hsc.chemistry = scanner.nextFloat();
if((s[i].hsc.chemistry<0) || (s[i].hsc.chemistry>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].hsc.chemistry<0) || (s[i].hsc.chemistry>100));
do{
System.out.print("4. Maths: ");
s[i].hsc.maths = scanner.nextFloat();
if((s[i].hsc.maths<0) || (s[i].hsc.maths>100)){
System.out.println("!!! Invalid Marks, Enter Again !!!\n");
}
}while((s[i].hsc.maths<0) || (s[i].hsc.maths>100));
do{