You are on page 1of 1

import java.util.

Scanner;
public class Main{
public static void main (String[]args){
Scanner x = new Scanner (System.in);
double t[] = new double[5];
t[0] = x.nextDouble();
System.out.print("enter the marks for physics");
t[1] = x.nextDouble();
System.out.print("enter the marks for chemistry");
t[2] = x.nextDouble();
System.out.print("enter the marks for maths");
t[3] = x.nextDouble();
System.out.print("enter the marks for biology");
t[4] = x.nextDouble();
System.out.print("enter the marks for computer science");
double Sum = t[0]+t[1]+t[2]+t[3]+t[4];
System.out.print ("total marks= "+ Sum);
double Average = Sum/5;
System.out.print ("Average marks= "+ Average);
if(Average>=20){
System.out.print("excellent!");
}
if(Average>=24) {
System.out.print("and carry on");
}
if(Average<24){
System.out.print("better luck next time!");
}
else{
System.out.print("need to work more!"); }
}
}
}

You might also like