Skip to content

Commit 9da01f4

Browse files
authored
Add files via upload
Signed-off-by: kalyani chaudhari <138003080+misskalyani@users.noreply.github.com>
1 parent 4f389d0 commit 9da01f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+4923
-0
lines changed

CORE JAVA/Amulya/src/SY/SYmarks.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package SY;
2+
3+
public class SYmarks
4+
{
5+
int ct,mt,et;
6+
public SYmarks(int ct,int mt,int et)
7+
{
8+
this.ct=ct;
9+
this.mt=mt;
10+
this.et=et;
11+
}
12+
public void disp()
13+
{
14+
System.out.println("\nSy Marks");
15+
System.out.println("Computer\tMaths\tElectronics");
16+
System.out.println(ct+"\t"+mt+"\t"+et);
17+
}
18+
}

CORE JAVA/Amulya/src/Student.java

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import SY.*;
2+
import TY.*;
3+
import java.util.*;
4+
5+
public class Student
6+
{
7+
int rno;
8+
String name;
9+
SYmarks sy;
10+
TYmarks ty;
11+
double per;
12+
char grade;
13+
Student(int rno,String name,int ct,int mt,int et,int Theory,int Practicals)
14+
{
15+
sy=new SYmarks(ct, mt, et);
16+
ty=new TYmarks(Theory, Practicals);
17+
this.rno=rno;
18+
this.name=name;
19+
perCalc(ct, mt, et, Theory, Practicals);
20+
Grade();
21+
}
22+
void perCalc(int ct,int mt,int et,int Theory,int Practicals)
23+
{
24+
this.per=(double)(ct+mt+et+Theory+Practicals)/5;
25+
}
26+
27+
void Grade()
28+
{
29+
if(per>=70)
30+
grade='A';
31+
else if(per>=60)
32+
grade='B';
33+
else if(per>=50)
34+
grade ='C';
35+
else if(grade>=40)
36+
grade='D';
37+
else
38+
grade='F';
39+
}
40+
void disp()
41+
{
42+
System.out.println(rno+name+sy+ty+per+grade);
43+
}
44+
public static void main(String[] args)
45+
{
46+
Scanner sc=new Scanner(System.in);
47+
System.out.println("Enter Limit ");
48+
int n=sc.nextInt();
49+
Student ob[]= new Student[n];
50+
for (int i =0;i<n;i++)
51+
{
52+
System.out.println("Enter roll no :: ");
53+
int r=sc.nextInt();
54+
System.out.println("Enter Name :: ");
55+
String nm=sc.next();
56+
System.out.println("Enter Computer Marks :: ");
57+
int c=sc.nextInt();
58+
System.out.println("Enter MAth MArks");
59+
int m=sc.nextInt();
60+
System.out.println("Enter Eletronic marks");
61+
int e=sc.nextInt();
62+
System.out.println("Enter Theory marks");
63+
int t=sc.nextInt();
64+
System.out.println("Enter Practal marks");
65+
int p=sc.nextInt();
66+
ob[i]=new Student(r, nm, c, m, e, t, p);
67+
ob[i].disp();
68+
}
69+
70+
71+
}
72+
73+
}

CORE JAVA/Amulya/src/TY/TYmarks.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package TY;
2+
3+
public class TYmarks
4+
{
5+
int Theory,Practicals;
6+
public TYmarks(int Theory,int Practicals)
7+
{
8+
this.Theory=Theory;
9+
this.Practicals=Practicals;
10+
}
11+
public void disp()
12+
{
13+
System.out.println("\nTy Marks ");
14+
System.out.println("Theory\tPracticals");
15+
System.out.println(Theory+"\t"+Practicals);
16+
}
17+
}
18+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package Operation;
2+
3+
class Maximum
4+
{
5+
public void add(int a,int b)
6+
{
7+
System.out.println(a+b);
8+
}
9+
public void sub(float a,float b)
10+
{
11+
System.out.println(a-b);
12+
}
13+
}
14+
public class Addition extends Maximum
15+
{
16+
public void max(int a,int b)
17+
{
18+
if(a>b)
19+
System.out.println("a max");
20+
else
21+
System.out.println("b max");
22+
}
23+
}
24+

CORE JAVA/Chakuli/src/main.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import Operation.*;
2+
import java.util.*;
3+
public class main
4+
{
5+
6+
public static void main(String[] args)
7+
{
8+
int n1,n2;
9+
float num1,num2;
10+
Scanner sc=new Scanner(System.in);
11+
System.out.println("Enter first no=");
12+
n1=sc.nextInt();
13+
System.out.println("Enter second no=");
14+
n2=sc.nextInt();
15+
System.out.println("Enter third no=");
16+
num1=sc.nextFloat();
17+
System.out.println("Enter fourth no=");
18+
num2=sc.nextFloat();
19+
Addition ob1=new Addition();
20+
ob1.add(n1,n2);
21+
ob1.sub(num1,num2);
22+
ob1.max(n1,n2);
23+
24+
}
25+
26+
}

CORE JAVA/Demo/src/Demo.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class Demo
2+
{
3+
void evenodd(int n)
4+
{
5+
if(n%2==0)
6+
System.out.print("\nNumber is Even");
7+
else
8+
System.out.print("\nNumber is Odd");
9+
}
10+
void leapyear(int y)
11+
{
12+
if(y%4==0)
13+
System.out.print("\nYear is Leap Year");
14+
else
15+
System.out.print("\nYear is Not Leap Year");
16+
}
17+
void square(int n)
18+
{
19+
int s=n*n;
20+
System.out.print("\nSquare="+s);
21+
}
22+
public static void main(String arg[])
23+
{
24+
Demo ob; //create object
25+
ob=new Demo(); //Allocate memory
26+
ob.evenodd(5); //calling functions
27+
ob.leapyear(2024);
28+
ob.square(5);
29+
}
30+
}

CORE JAVA/Exception/src/Error.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import java.io.*;
2+
public class Error {
3+
4+
public static void main(String[] args) {
5+
int b=0,c=0,d=0,e=0;
6+
try
7+
{
8+
int a=7;
9+
b=a-3;
10+
c=a+8;
11+
d=a/0;
12+
e=a*7;
13+
}
14+
catch(Exception e1)
15+
{
16+
System.out.println("Error = "+e1);
17+
}
18+
finally
19+
{
20+
System.out.println("Addition = "+b);
21+
System.out.println("Subtraction = "+c);
22+
System.out.println("Division = "+d);
23+
System.out.println("Multiplication = "+e);
24+
}
25+
}
26+
27+
}

CORE JAVA/Exception/src/Throw.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import java.io.*;
2+
public class Throw {
3+
//DataInputStream la throw kiva try catch use karav lagta nahi tr error show hoteerty
4+
public static void main(String[] args) throws Exception
5+
{
6+
try
7+
{
8+
DataInputStream dis=new DataInputStream(System.in);
9+
System.out.println("Enter Name = ");
10+
String name = dis.readLine();
11+
System.out.println("Name = "+name);
12+
}
13+
catch(Exception e1)
14+
{
15+
System.out.println("Error = "+e1);
16+
}
17+
}
18+
19+
}

CORE JAVA/Exception/src/ThrowTry.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import java.io.*;
2+
public class ThrowTry
3+
{
4+
5+
public static void main(String[] args) throws Exception
6+
{
7+
DataInputStream dis=new DataInputStream(System.in);
8+
System.out.println("Enter Name = ");
9+
String name = dis.readLine();
10+
System.out.println("Name = "+name);
11+
12+
13+
}
14+
15+
}

CORE JAVA/Exception/src/Try.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.io.*;
2+
public class Try {
3+
4+
public static void main(String[] args) {
5+
try
6+
{
7+
DataInputStream dis=new DataInputStream(System.in);
8+
System.out.println("Enter Name = ");
9+
String name = dis.readLine();
10+
System.out.println("Name = "+name);
11+
}
12+
catch(Exception e1)
13+
{
14+
System.out.println("Error = "+e1);
15+
}
16+
}
17+
18+
}

0 commit comments

Comments
 (0)