PERCENTAGE CALCULTOR ( USER INPUT)

 CBSE PERCENTAGE CALCULATOR

package com.company;
import java.util.Scanner;

public class CWH_1_Excercise {
public static void main(String[] args) {
Scanner m=new Scanner(System.in);
System.out.println("Enter the marks of maths");
float ma= m.nextFloat();
System.out.println("Enter the marks of science");
float sci=m.nextFloat();
System.out.println("Enter the marks of english");
float e=m.nextFloat();
System.out.println("Enter the marks of social science");
float sc=m.nextFloat();
System.out.println("Enter the marks of hindi");
float h=m.nextFloat();
float sum= ma+sci+e+sc+h;
System.out.println(sum);
System.out.print("percentage is:");
float percentage= (sum/5);
System.out.println(percentage);


}
}

Comments