Code Below:


import java.util.*;
class student
{
    String name;
    int age;
    double m1,m2,m3;
    double maximum;
    double average;
    
    student(String n, int a, double x, double y, double z)
    {
        name=n;
        age=a;
        m1=x;
        m2=y;
        m3=z;
    }
    
    void accept()
    {
        Scanner s=new Scanner (System.in);
        System.out.println("Enter name");
        name=s.nextLine();
        System.out.println("Enter age");
        age=s.nextInt();
        System.out.println("Enter marks");
        m1=s.nextDouble();
        m2=s.nextDouble();
        m3=s.nextDouble();
    }
    
    void compute()
    {
        maximum=Math.max(Math.max(m1,m2),m3);
        average=(m1+m2+m3)/3.0;
    }
    
    void display()
    {
        System.out.println("Name:"+name);
        System.out.println("Age:"+age);
        System.out.println("Max:"+maximum);
        System.out.println("Avg.:"+average);
    }
    
    public static void main()
    {
        student obj=new student("",0,0.0,0.0,0.0);
        obj.accept();
        obj.compute();
        obj.display();
    }
}