-
Notifications
You must be signed in to change notification settings - Fork 1
/
Students1.java
57 lines (45 loc) · 1.47 KB
/
Students1.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
import java.util.*;
public class Students1
{
String sub[]=new String[6];
int internal[]=new int[6];
int theory[]=new int[6];
void getdata()
{
int i;
Scanner sc=new Scanner(System.in);
for(i=0;i<6;i++)
{
System.out.println("Enter the subject:");
sub[i]=sc.next();
System.out.println("Enter the internal marks :");
internal[i]=sc.nextInt();
System.out.println("Enter the theory marks :");
theory[i]=sc.nextInt();
}
}
void show()
{
int i;
for(i=0;i<6;i++)
{
System.out.println("Subject:"+sub[i]);
System.out.println("Internal marks:"+internal[i]);
System.out.println("Theory marks:"+theory[i]);
System.out.println("Grandtotal:"+(internal[i]+theory[i]));
}
}
public static void main(String args[])
{
Students1 std1=new Students1();
System.out.println("Enter the data for 1st student:");
std1.getdata();
System.out.println("Information for 1st stud:");
std1.show();
Students1 std2=new Students1();
System.out.println("Enter the data for 2nd student:");
std2.getdata();
System.out.println("Information for 2nd stud:");
std2.show();
}
}