Write a program to accept the Mark's of a student obtained in 5 different subjects (english,phy,chem,biology,maths) and find the average is80% or more then he/she is eligible to get "computer science " otherwise biology
Answers
Answered by
4
import java.util.*;
class one
{
public static void main()
{
int a;int b;double c;double d;
System.out.println("Input 5 Numbers");
Scanner Ravi = new Scanner(System.in);
for (int x = 1;x<=5;x++)
{
a = Ravi.nextInt()
b=b+a;
c++;
}
d = (double)(b/c);
if(d>=80)
{
System.out.println("You are eligible for computer science");
}
else
{
System.out.println("You are eligible for biology");
}}}
Similar questions