-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarks.java
More file actions
executable file
·53 lines (47 loc) · 1.17 KB
/
marks.java
File metadata and controls
executable file
·53 lines (47 loc) · 1.17 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
import java.io.*;
class marks
{
public static void main(String[] args)
{
int mat[] = new int[10];
int phy[] = new int[10];
int che[] = new int[10];
int tot[] = new int[10];
int n,i;
String s[] = new String[10];
InputStreamReader in = new InputStreamReader(System.in);
BufferedReader bf = new BufferedReader(in);
System.out.println("Enter the no. of Students");
try
{
n = Integer.parseInt(bf.readLine());
for(i=1;i<=n;i++)
{
System.out.println("Enter the Name for student "+i);
s[i] = bf.readLine();
System.out.println("Enter Marks in Maths for "+s[i]);
mat[i] = Integer.parseInt(bf.readLine());
System.out.println("Enter Marks in Physicss for "+s[i]);
phy[i] = Integer.parseInt(bf.readLine());
System.out.println("Enter Marks in Chemistry for "+s[i]);
che[i] = Integer.parseInt(bf.readLine());
tot[i] = mat[i]+phy[i]+che[i];
}
System.out.println("The list of eligible candidates \n");
for(i=1;i<=n;i++)
{
if(mat[i]>=60 && phy[i]>=50 && che[i]>=40 )
{
if(tot[i]>=200 || (mat[i]+phy[i])>=150)
{
System.out.println"\t"+(s[i]+"\n");
}
}
}
}
catch(Exception e)
{
System.out.println("I/O error");
}
}
}