-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAcademic.java
45 lines (37 loc) · 1.32 KB
/
Academic.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
//Read student name, roll no and subject marks to find total, and percentage
import java.lang.*;
import java.util.*;
class Academic
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter your name: ");
String nm=sc.nextLine();
System.out.print("Enter your Roll Number: ");
int rn=sc.nextInt();
System.out.print("Enter marks of subject ENGLISH");
int s1=sc.nextInt();
System.out.print("Enter marks of subject MARATHI");
int s2=sc.nextInt();
System.out.print("Enter marks of subject HINDI/SANSKRIT");
int s3=sc.nextInt();
System.out.print("Enter marks of subject HISTORY & GEOGRAPHY");
int s4=sc.nextInt();
System.out.print("Enter marks of subject MATHEMATICS");
int s5=sc.nextInt();
System.out.print("Enter marks of subject SCIENCE");
int s6=sc.nextInt();
int total=s1+s2+s3+s4+s5+s6;
float percent=(float)total/6;
System.out.println("Name of student: "+nm);
System.out.println("ENGLISH: "+s1);
System.out.println("MARATHI: "+s2);
System.out.println("HINDI/SANSKRIT: "+s3);
System.out.println("HISTORY & GEOGRAPHY: "+s4);
System.out.println("MATHEMATICS: "+s5);
System.out.println("SCIENCE: "+s6);
System.out.println("TOTAL MARKS OF 600: "+total);
System.out.println("PERCENTAGE: "+percent);
}
}