import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class StudentsData {
int math,hindi,english, science;
String name,fname,classs,dob,id, mobile;
public void result() {
System.out.println("The result of "+name);
float result = (math+hindi+english+science)/4f;
System.out.println("= "+result+"%");
}
public void info(){
System.out.println("<<<<<INFORMATION>>>>>\nName="+name+"\nFather name ="+fname+"\nClass="+classs+"\nD.O.B = "+dob+"\nMob No.="+mobile+"\nStudent ID ="+id);
}
// all school data
public void data(){
System.out.println("s1,s2.... are students [ID]");
System.out.println(" s1 = Hariprasad Daku\n s2 = Tonny Kakkar \n s3 = Riya Singh\n s4 = Yash Solanki \n s5 = Tannu Rajhh \n s6 = Tina Malviya ");
}
}
class Main {
public static void main(String[] args) {
System.out.println("Hello World School :°:");
// object define
StudentsData s1 = new StudentsData();
StudentsData s2 = new StudentsData();
StudentsData s3 = new StudentsData();
StudentsData s4 = new StudentsData();
StudentsData s5 = new StudentsData();
StudentsData s6 = new StudentsData();
StudentsData school = new StudentsData();
//students names
s1.name ="Hariprasad Daku";
s2.name ="Tonny Kakkar";
s3.name ="Riya Singh";
s4.name ="Yash Solanki";
s5.name ="Tannu Rajhh";
s6.name ="Tina malviya";
// student id or mobile no
s1.id ="s1"; s1.mobile ="9907897987";
s2.id ="s2"; s2.mobile ="9908807889";
s3.id ="s3"; s3.mobile ="9996767577";
s4.id ="s4"; s4.mobile ="6788579869";
s5.id ="s5"; s5.mobile ="8988688679";
s6.id ="s6"; s6.mobile ="6557689778";
// student classs
s1.classs = "10th-A";
s2.classs = "9th-B";
s3.classs = "8th-Extra";
s4.classs = "11th-B";
s5.classs = "7th-A";
s6.classs = "5th-C";
// student D.O.B
s1.dob = "04/09/2007";
s2.dob = "30/07/2008";
s3.dob = "15/11/2010";
s4.dob = "22/08/2004";
s5.dob = "14/08/2008";
s6.dob = "01/01/2012";
// student father name
s1.fname ="Samandar Singh Daku";
s2.fname ="Ramu Kakkar";
s3.fname ="Prakash Singh";
s4.fname ="Badri Solanki";
s5.fname ="Kalin Rajhh";
s6.fname ="Guddu malviya";
// students marks
s1.math = 72 ;
s1.english = 88 ;
s1.science = 58 ;
s1.hindi = 68 ;
s2.math = 87 ;
s2.english = 88 ;
s2.science = 74 ;
s2.hindi = 89 ;
s3.math = 58 ;
s3.english = 67 ;
s3.science = 56 ;
s3.hindi = 87 ;
s4.math = 76 ;
s4.english = 83 ;
s4.science = 62 ;
s4.hindi = 87 ;
s5.math = 85 ;
s5.english = 90 ;
s5.science = 75 ;
s5.hindi = 88 ;
// finished
school.data();
//s1.info();
s5.result();
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: