Sunday, 23 September 2012

Student Details

/* Simple Java Program For Displaying Name, Roll no. MArks and total of a student*/

class stud
{
public static float tot;
public static int rno;
public static String name;
public static int m1,m2,m3;

public void calc()
{
tot=(m1+m2+m3)/3;
}
public void op()
{
System.out.println("rollno="+rno);
System.out.println("name="+name);
System.out.println("%="+tot);
}
public static void main(String args[])
{
stud s=new stud();
rno=Integer.parseInt(args[0]);
name=args[1];
m1=Integer.parseInt(args[2]);
m2=Integer.parseInt(args[3]);
m3=Integer.parseInt(args[4]);

s.calc();
s.op();
}
}

0 comments:

Post a Comment