java percentage calculator

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

public class tut6{
public static void main(String[] args) {
Scanner scan =new Scanner(System.in);
System.out.println("math mark");
float maths=scan.nextFloat();
System.out.println("hindi mark");
float hindi=scan.nextFloat();
System.out.println("eng mark");
float eng=scan.nextFloat();
System.out.println("urdu mark");
float urdu=scan.nextFloat();
System.out.println("sst mark");
float sst=scan.nextFloat();
System.out.println("bio mark");
float bio=scan.nextFloat();
float total =(maths +hindi+sst+urdu+bio+eng)/600.0f*100;
System.out.println("the percentage is");
System.out.println(total);

}

} 

output :

math mark

64

hindi mark

21

eng mark

68

urdu mark

32

sst mark

34

bio mark

98

the percentage is

52.833332




Comments

Popular posts from this blog

Gove confirms mandatory housebuilding targets for councils will be abolished in face of Tory rebellion – UK politics live

Kotak Mahindra Bank Recruitment 2022 Released for Graduate Candidates And Apply Online