:(-: i went code to get the max ,min number and avg for the following code :
import java.util.Scanner;
class Student{
int mark1;
int mark2;
Student(int mar1, int mar2){
mark1=mar1;
mark2=mar2;
}
public int getMark1(){ return mark1; }
public int getMark2(){ return mark2;}
public int findTotal(){
int ft=mark1+mark2;
return ft;
}
}
class Driver{
public static void main(String[] arg){
Scanner sk=new Scanner(System.in);
Student[] stu=new Student[5];
for(int i=0; i<5; i++){
System.out.println("Enter the mark1 and mark2 of Student5: "+(i+1));
int mar1=sk.nextInt();
int mar2=sk.nextInt();
stu[i]=new Student(mar1,mar2);}
for(int i=0; i<5; i++){
System.out.println("Details of Rectangle "+(i+1));
System.out.println("=====================");
System.out.println("Mark1: "+stu[i].getMark1());
System.out.println("Height: "+stu[i].getMark2());
System.out.println("Total: "+stu[i].findTotal());
System.out.println("=====================");
}
}
}
i hope from you help me :(sweat):
thanx alot :(nod):

