TOTAL AND PERCENTAGE of subjects

import java.util.*;
class avg
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);
float english,maths,chemistry,total,avg;
System.out.println("enter the marks of english");
english=s.nextFloat();
System.out.println("enter the marks of maths");
maths=s.nextFloat();
System.out.println("enter the marks of chemistry");
chemistry=s.nextFloat();
total=english+maths+chemistry;
System.out.println("TOTAL:"+total);
avg=total/3.0;
System.out.println("AVERAGE:"+avg);
}
} 
OUTPUT:
enter the marks of english
55
enter the marks of maths
66
enter the marks of chemistry
55
TOTAL:176
AVERAGE:58.66
Translate »