Tuesday, 21 August 2018

Write a program that calculate percentage marks of the student if marks of 6 subjects are given in java.


import java.util.Scanner;
class student
{
public static void main(String args[])
{
int roll_no,age, int aem,int dbms,int ds,int oopc,int eem;
String name;
String branch;
float perc;
Scanner sc=new Scanner(System.in);
System.out.println("enter roll_no:");
roll_no=sc.nextInt();
System.out.println("enter the name of student:");
name=sc.next();
System.out.println("enter the age of student:");
age=sc.nextInt();
System.out.println("enter the branch of student:");
branch=sc.next();
System.out.println("enter the marks of aem:");
aem=sc.nextInt();
System.out.println("enter the marks of dbms:");
dbms=sc.nextInt();
System.out.println("enter the marks of ds:");
ds=sc.nextInt();
System.out.println("enter the marks of oopc:");
oopc=sc.nextInt();
System.out.println("enter the marks of eem:");
eem=sc.nextInt();
perc=(aem+dbms+ds+oopc+eem)/5;
System.out.println("enter roll_no:" +roll_no);
System.out.println("enter the name of student:" +name);
System.out.println("enter the age of student:" +age);
System.out.println("enter the branch of student:" +branch);
System.out.println("enter the marks of aem:" +aem);
System.out.println("enter the marks of dbms:" +dbms);
System.out.println("enter the marks of ds:" +ds);
System.out.println("enter the marks of oopc:" +oopc);
System.out.println("enter the marks of eem:" +eem);
System.out.println("perc:" +perc);
}
}
output:
 

THANK YOU!!!! 

No comments:

Post a Comment