class Student1
{
int rn,m1,m2,m3,age,avg,total;
String name,email,std,add,city,state,gender,phn;
void mahi(int r,int a,int b,int c,int d)
{
rn=r;
m1=a;
m2=b;
m3=c;
age=d;
std="Munnabhai M.B.B.S";
name="Mahi";
email="mahi@yahoo.com";
add="Katargam";
city="Surat";
state="Gujarat";
gender="Male";
phn="8866046925";
total=m1+m2+m3;
avg=total/3;
}
void show()
{
System.out.println(" Roll Number = "+rn);
System.out.println(" Name = "+name);
System.out.println(" Age = "+age);
System.out.println(" Gender = "+gender);
System.out.println(" E-mail id = "+email);
System.out.println(" Mobile Number = "+phn);
System.out.println(" Address = "+add);
System.out.println(" City = "+city);
System.out.println(" State = "+state);
System.out.println(" Standard = "+std);
System.out.println(" Marks of C Language = "+m1);
System.out.println(" Marks of Java = "+m2);
System.out.println(" Marks of SQL = "+m3);
System.out.println(" Total Marks = "+total);
System.out.println(" Average = "+avg);
}
public static void main(String surat[])
{
Student1 s=new Student1();
s.mahi(1,99,99,99,20);
s.show();
}
}
Output:
{
int rn,m1,m2,m3,age,avg,total;
String name,email,std,add,city,state,gender,phn;
void mahi(int r,int a,int b,int c,int d)
{
rn=r;
m1=a;
m2=b;
m3=c;
age=d;
std="Munnabhai M.B.B.S";
name="Mahi";
email="mahi@yahoo.com";
add="Katargam";
city="Surat";
state="Gujarat";
gender="Male";
phn="8866046925";
total=m1+m2+m3;
avg=total/3;
}
void show()
{
System.out.println(" Roll Number = "+rn);
System.out.println(" Name = "+name);
System.out.println(" Age = "+age);
System.out.println(" Gender = "+gender);
System.out.println(" E-mail id = "+email);
System.out.println(" Mobile Number = "+phn);
System.out.println(" Address = "+add);
System.out.println(" City = "+city);
System.out.println(" State = "+state);
System.out.println(" Standard = "+std);
System.out.println(" Marks of C Language = "+m1);
System.out.println(" Marks of Java = "+m2);
System.out.println(" Marks of SQL = "+m3);
System.out.println(" Total Marks = "+total);
System.out.println(" Average = "+avg);
}
public static void main(String surat[])
{
Student1 s=new Student1();
s.mahi(1,99,99,99,20);
s.show();
}
}
Output:
No comments:
Post a Comment