import java.util.*; class Student { Scanner sc= new Scanner(System.in); int Enrollment_id; string name; int sub1,sub2,sub3,total; Student() { readInfo(); } public void readInfo() { System.out.println("Enter Students details:"); System.out .println("Enrollment_id:"); Enrollment_id=sc.nextInt(); System.out.println("name:"); name=sc.next(); System.out.println("Enter marks in 3 subjects:"); sub1=sc.nextInt(); sub2=sc.nextInt(); sub3=sc.nextInt(); if(sub1>=50&&sub2>=50&&sub3>=3) { total=sub1+sub2+sub3; } else } total=0; } } public void display() { System.out.println(Enrollment_id+"/t/t"+name+"/t"+total); } } class StudentResult { public static void main(String args[]) { Student s[]=new Student[3]; for(int i=0;i<3;i++) { s[i]=new Student(); } System.out.println("Student details"); System.out.println("Enrollment_id/tname/ttotal"); for(int i=0;i<3;i++) { s[i].display(); } } }