Computer Science, asked by pritymall1982, 9 months ago

Q5. Write a program to calculate the percentage of a student of five different subjects (Hindi, English, Science,
Math, Computer ) and print his/her division. The conditions to calculate division is-
Percentage 60
A Grade
45<= Percentage< 60
B Grade
33< Percentage<45
C Grade
Percentage<33


in bluej language​

Answers

Answered by mn121
0

import java.util.*;

public class program

{

public static void main(String args[])

{

Scanner sc = new Scanner(System.in);

double h,e,s,m,c,p;

System.out.println("Enter hindi marks: ");

h = sc.nextDouble();

System.out.println("Enter english marks: ");

e = sc.nextDouble();

System.out.println("Enter science marks: ");

s = sc.nextDouble();

System.out.println("Enter maths marks: ");

m = sc.nextDouble();

System.out.println("Enter computer marks: ");

c = sc.nextDouble();

p = ((h+e+s+m+c)/500.0)*100;

if(p>=60)

{

System.out.println("A grade");

}

if(p>=45&&p<60)

{

System.out.println("B grade");

}

if(p>=33&&p<45)

{

System.out.println("C grade");

}

if(p<33)

{

System.out.println("D grade");

}

}

}

Hope it helps you...

Please mark it as brainliest...

^_^

Similar questions