From 0db1e4eb5e10e5c3d84ce2d3510520d913b36436 Mon Sep 17 00:00:00 2001 From: Hammad Date: Sun, 18 Sep 2022 19:42:16 +0530 Subject: [PATCH] Added by Hammad --- .../Grading of Students/Grades.class | Bin 0 -> 1954 bytes .../Grading of Students/Grades.java | 49 ++++++++++++ .../Grading of Students/Grades.txt | 49 ++++++++++++ .../Grading of Students/StudentGrades.class | Bin 0 -> 357 bytes .../Grading of Students/StudentGrades.java | 25 ++++++ .../Grading of Students/StudentGrades.txt | 25 ++++++ .../Grading of Students/complete code.txt | 74 ++++++++++++++++++ 7 files changed, 222 insertions(+) create mode 100644 Project(Week 1)/Grading of Students/Grades.class create mode 100644 Project(Week 1)/Grading of Students/Grades.java create mode 100644 Project(Week 1)/Grading of Students/Grades.txt create mode 100644 Project(Week 1)/Grading of Students/StudentGrades.class create mode 100644 Project(Week 1)/Grading of Students/StudentGrades.java create mode 100644 Project(Week 1)/Grading of Students/StudentGrades.txt create mode 100644 Project(Week 1)/Grading of Students/complete code.txt diff --git a/Project(Week 1)/Grading of Students/Grades.class b/Project(Week 1)/Grading of Students/Grades.class new file mode 100644 index 0000000000000000000000000000000000000000..864e16676b419023b54ffc2c5515c091d7d527c2 GIT binary patch literal 1954 zcmaJ?+fo!)6kP{~>6xavh=Kw}fq)JpFb3}#f&wx!hMP8G2uaLgrUT6k-BaB?R!AO` zFGy7^t5SK%i_ftFTITWrKI8-PDVCLF^#vINm4`l;efHUxwf5Ql^6wXa02qgzL>=lC z#56P@F3`FuAIeNwTI(5o+x3hsfqJ{@3AE1!C#IcQbWF?BJ;#t+*#r^->a^t7LG6=)io&@6EDkUIiO#kWwlXfzdC4gGl(uV)9BlW4^e1#KFR;+R1EmLrRX%RpSO zN}H<(@Ax-5G#tkXfjYN9rBJ8pndOXLkd|dQSruLAR&Y|oJ2)k9B#5n6Lm*}uUozKY zslkIj66g_V3{%~bPRaG1_Gx$*{Q?bvgw9uUD$d}nf|Q0qqy<{`0nL?dN$YAwI<66I z4n=@AS}~+y7$a174e!DF9t5euWfkY~o`O*g7jSWpu^^8L$C29vD(2b_9W|s@bA!vV z$sQm!IRp3sU)6BU2el!vm_U}=ixavYo1FEv9svnl=keV1-TYE)^0B|4WZpOP`ci&= zYAL@kpTJFC%1z{F6UdRndGel2Cg%c7lF5**Hdfb+hCFTy9N&^9W6HJ)(z|bZ8(g`b zv^)lS?GXNR2cbWN4HdJPQ!uY#!3U|PY!}uxjRLcekC~R~jVrkG)-em0RpwW{u3-uH z$eHO^V(69Sowq90z4G=;=DzRZBY_i9tp8CNToy>IlcJ*ZBypLtiw0SrH7#Sly0vCF zOLDDDNt5o$LTOG`qP z9BV2HC@L^~biWYj-!CxJdT5u7OqgN_cup2P+o6}owNOWjq0t#>70ZU(KWp2iY9)IR z{u;?!7nimx#v$sp?=vJLTT5VMVoH|Fy6G8gAsYfo!3qjK0WI%8*Qv5}UBgvS5*Rp; z;$e|1V6!^)|EesDFirIGF|gzjhXr05|H# zx?9zsaQP`jo3e{!`WLixb7`$_M)@<5cO3RBliux;a5{V`yYb5AykLKbH~a z0JK9v2U^&V&l15=bmBH2(mkAnWOikohR5@-$bp|%6XLH~0I9wX?9OjMRS9Z} zj@e2gP*(!hf#LKse3))ke~a&+m-Fvf+`*N-MN9fubgewa-Dg_?=oyyfF0kY8fFGZxnr~m)} literal 0 HcmV?d00001 diff --git a/Project(Week 1)/Grading of Students/Grades.java b/Project(Week 1)/Grading of Students/Grades.java new file mode 100644 index 0000000..4c88510 --- /dev/null +++ b/Project(Week 1)/Grading of Students/Grades.java @@ -0,0 +1,49 @@ +import java.util.Scanner; +import java.util.Arrays; +public class Grades { + float marks[]; + String grade[]; + String stu[]; + Scanner sc; + + public void get_data() { + for(int i=0;i<10;i++) { + System.out.println("Enter name"); + stu[i]=sc.next(); + System.out.println("Enter marks"); + marks[i]=Float.parseFloat(sc.next()); + } + set_grades(); + +} + + private void set_grades() { + Arrays.sort(marks); + for(int i=0;i<10;i++) { + if(marks[i]>=40 && marks[i]<=50) + grade[i]="PASS"; + else if(marks[i]>=51 && marks[i]<=75) + grade[i]="MERIT"; + + else if(marks[i]>=76) + grade[i]="DISTINCTION"; + else + grade[i]="FAIL"; + } +} + + public void display() { + System.out.println("Name\t\t\tMarks\t\t\tGrades"); + + for(int i=0;i<10;i++) { + System.out.println(stu[i]+"\t\t\t"+marks[i]+"\t\t\t"+grade[i]); + } +} + public Grades(){ + marks=new float[10]; + grade=new String[10]; + stu=new String[10]; + sc = new Scanner(System.in); +} + +} diff --git a/Project(Week 1)/Grading of Students/Grades.txt b/Project(Week 1)/Grading of Students/Grades.txt new file mode 100644 index 0000000..4c88510 --- /dev/null +++ b/Project(Week 1)/Grading of Students/Grades.txt @@ -0,0 +1,49 @@ +import java.util.Scanner; +import java.util.Arrays; +public class Grades { + float marks[]; + String grade[]; + String stu[]; + Scanner sc; + + public void get_data() { + for(int i=0;i<10;i++) { + System.out.println("Enter name"); + stu[i]=sc.next(); + System.out.println("Enter marks"); + marks[i]=Float.parseFloat(sc.next()); + } + set_grades(); + +} + + private void set_grades() { + Arrays.sort(marks); + for(int i=0;i<10;i++) { + if(marks[i]>=40 && marks[i]<=50) + grade[i]="PASS"; + else if(marks[i]>=51 && marks[i]<=75) + grade[i]="MERIT"; + + else if(marks[i]>=76) + grade[i]="DISTINCTION"; + else + grade[i]="FAIL"; + } +} + + public void display() { + System.out.println("Name\t\t\tMarks\t\t\tGrades"); + + for(int i=0;i<10;i++) { + System.out.println(stu[i]+"\t\t\t"+marks[i]+"\t\t\t"+grade[i]); + } +} + public Grades(){ + marks=new float[10]; + grade=new String[10]; + stu=new String[10]; + sc = new Scanner(System.in); +} + +} diff --git a/Project(Week 1)/Grading of Students/StudentGrades.class b/Project(Week 1)/Grading of Students/StudentGrades.class new file mode 100644 index 0000000000000000000000000000000000000000..2c16ffcf0fa9b5996d2c16069c4de656f6085186 GIT binary patch literal 357 zcmY*U!AiqG6r4@cZW>eDMy*~vcxx5x$&=EHpqHYDNI^Wvrdh(4bSvpb@Uy&FQ1Ao% zDDgc#6c={p?d+S`eP7@2p8&=k7gdIIg#)w#CrFF+u;T;^J! zGci`*)Qe14cPcAM2^Pv&f&SoOviVW!Dr1ZD;Zz_>mvuGMSB9IDf2pTzz!ADM87~il zXCqALbVw|S8^>#iS1JT{2>F`p7Iv{m%&li+<%r$~=40 && marks[i]<=50) + grade[i]="PASS"; + else if(marks[i]>=51 && marks[i]<=75) + grade[i]="MERIT"; + + else if(marks[i]>=76) + grade[i]="DISTINCTION"; + else + grade[i]="FAIL"; + } +} + + public void display() { + System.out.println("Name\t\t\tMarks\t\t\tGrades"); + + for(int i=0;i<10;i++) { + System.out.println(stu[i]+"\t\t\t"+marks[i]+"\t\t\t"+grade[i]); + } +} + public Grades(){ + marks=new float[10]; + grade=new String[10]; + stu=new String[10]; + sc = new Scanner(System.in); +} + +} +public class StudentGrades { + + public static void main(String args[]) { + + + Grades g1=new Grades(); + g1.get_data(); + g1.display(); + +} + +} + + + + + + + + + + + + +