Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Computer assignment

class Student
{ String Name;
int M1,M2,M3;
Student(String Name,int M1,int M2,int M3)
{
this.Name=Name;
this. M1=M1;
this. M2=M2;
this. M3=M3;
}
void findmax()
{ System.out.println(Math.max(Math.max(M1,M2),M3));
}
void Display()
{ System.out.println(“ Student’s Name-“+ Name);
System.out.println(“Marks in English-“+M1);
System.out.println(“Marks in Mathematics-“+M2);
System.out.println(“Marks in Science-“+M3);
}
public static void main(String P[])throws IOException
{ BufferedReader br= new BufferedReader(new
InputStreamReader (System . in ));
System.out.println(“Enter the Student’s Name”);
String n= br.readLine();
System.out.println(“Enter the Marks in English “);
int e= Integer.parseInt(br.readLine());
System.out.println(“Enter the Marks in maths “);
int m= Integer.parseInt(br.readLine());
System.out.println(“Enter the Marks in Science “);
int s= Integer.parseInt(br.readLine());
Student Sdt = new Student (n,e,m,s);
Sdt.Display();
Sdt.findmax();
}
}

Kaustav Bangabash
Class—10A Roll no.—26

You might also like