0% found this document useful (0 votes)
12 views1 page

Grade

Uploaded by

manu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Grade

Uploaded by

manu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.util.

*;
public class marks
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int p,c,b;
float avg=0;
String name,gr="";
System.out.println("enter name");
name=in.nextLine();
System.out.println("enter marks in phy,bio,chem");
p=in.nextInt();
c=in.nextInt();
b=in.nextInt();
avg=(p+c+b)/3;
if(avg>80)
gr="distinction";
if(avg>=60&&avg<80)
gr="first class";
if(avg>=45&&avg<60)
gr="second class";
if(avg>=40&&avg<45)
gr="pass";
if(avg<40)
gr="you have failed better luck next time fool";
System.out.println("name="+name);
System.out.println("average="+avg);
System.out.println("grade="+gr);
}
}

You might also like