-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyXthMark.java
More file actions
63 lines (44 loc) · 1.55 KB
/
MyXthMark.java
File metadata and controls
63 lines (44 loc) · 1.55 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
package java.basic;
import java.util.Scanner;
public class MyXthMark {
public static void main(String[] args) {
// TODO Auto-generated method stub
MyXthMark mark=new MyXthMark();
Scanner joseph =new Scanner(System.in);
int tamil,english,maths,science,scoial;
System.out.print("Enter tamil marks=");
tamil=joseph.nextInt();
System.out.print("Enter english marks=");
english=joseph.nextInt();
System.out.print("Enter maths marks=");
maths=joseph.nextInt();
System.out.print("Enter science marks=");
science =joseph.nextInt();
System.out.print("Enter scoial marks=");
scoial=joseph.nextInt();
int Total=mark.add( tamil,english,maths,science,scoial);
mark.avg( Total);
System.out.println("10th Mark Total is=:"+ mark.add( tamil,english,maths,science,scoial));
System.out.println("10th Mark avg is="+ mark.avg( Total));
}
private int add( int tamil,int english,int maths,int science,int scoial){
int total= (tamil+english+maths+science+scoial);
return total;
}
private float avg( int Total){
float avgtotal=(Total)/5;
if(avgtotal>60){
System.out.println("first class");
if(avgtotal<60){
System.out.println("second class");
}
else if(avgtotal>50){
System.out.println("pass");
}
else{
System.out.println("RA");
}
}
return avgtotal;
}
}