forked from sourabh48/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.java
More file actions
70 lines (63 loc) · 1.12 KB
/
student.java
File metadata and controls
70 lines (63 loc) · 1.12 KB
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
import java.io.*;
class information
{
int n=0,m=0,i=0,j=0;
int stud[][]=new int[n][m];
int sum[]=new int[n];
void info()
{
DataInputStream dis= new DataInputStream(System.in);
try
{
System.out.println("ENTER THE NUMBER OF STUDENTS IN YOUR CLASS: \n");
n=Integer.parseInt(dis.readLine());
System.out.println("ENTER THE NUMBER OF SUBJECTS: \n");
m=Integer.parseInt(dis.readLine());
}
catch(Exception e)
{}
for( i=1;i<=n;i++)
{
for( j=1;j<=m;j++)
{
try
{
System.out.println("ENTER THE MARKS OF STUDENT OF ROLL NO:"+i+ "IN SUBJECT NO:"+j);
stud[i][j]=Integer.parseInt(dis.readLine());
}
catch(Exception e)
{}
}
}
}
void netmarks()
{
for(i=0;i<=n;i++)
{
for(j=0;j<=m;j++)
{
sum[i]=sum[i]+stud[n][m];
}
}
}
void output()
{
for(i=0;i<=n;i++)
{
for(j=0;j<=m;j++)
{
System.out.println("ENTER THE MARKS OF STUDENT OF ROLL NO:"+i+ "GOT"+sum[i]+"IN TOTAL");
}
}
}
}
public class student
{
public static void main(String args[])
{
information f=new information();
f.info();
f.netmarks();
f.output();
}
}