import java.util.*;
import java.lang.*;
import java.io.*;
// The main method must be in a class named "Main".
class StudentsResult {
int math,hindi, english, science;
String name;
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(name+" information\nSorry currently we haven't any information");
}
}
class Main {
public static void main(String[] args) {
System.out.println("Hello (°•°)");
// student score
StudentsResult s1 = new StudentsResult();
StudentsResult s2 = new StudentsResult();
StudentsResult s3 = new StudentsResult();
StudentsResult s4 = new StudentsResult();
StudentsResult s5 = new StudentsResult();
//students names
s1.name ="Hariprasad Daku";
s2.name ="Tonny Kakkar";
s3.name ="Riya Singh";
s4.name ="Yes Solanki";
s5.name ="Tannu Rajhh";
// 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
s5.result();
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: