Programming Tutorials

Comment on Tutorial - Student marks calculation program in Java By Paawan Chaudhary



Comment Added by : satya

Comment Added at : 2012-12-09 10:57:28

Comment on Tutorial : Student marks calculation program in Java By Paawan Chaudhary
import java.lang.*;
import java.io.*;
class student
{
String sname;
int stno,m1,m2,m3,total;
void read()
{
try
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter stno");
int stno=Integer.parseInt(br.readLine());
System.out.println("enter sname");
sname=br.readLine();
System.out.println("enter m1");
int m1=Integer.parseInt(br.readLine());
System.out.println("enter m2");
int m2=Integer.parseInt(br.readLine());
System.out.println("enter m3");
int m3=Integer.parseInt(br.readLine());
}
catch(Exception e)
{
}
}
void display()
{
System.out.println("\n student details");
System.out.println("\n stno :"+stno);
System.out.println("\n sname :"+sname);
System.out.println("\n m1 :"+m1);
System.out.println("\n m2 :"+m2);
System.out.println("\n m3 :"+m3);
System.out.println("\n total :"+calctot());
}
int calctot()
{
return(m1+m2+m3);
}
public static void main(String args[])
{
student s=new student();
s.read();
s.display();
}
}


View Tutorial