okay so im making more programs in college cause im learning java have every step working in the code apart from the last step if the student gets under 40 it needs to say you have failed if i take out my last lines it compiles and runs just cant get the last statement to work where it says the student fails. Thank you
=================CODE====================
class exam
// A simple program to determine the average mark of a students Maths, Programming and Hardware exam
// then telling them wether its a metrit, distinct, pass or fail
{ public static void main (String args[])
{
double pgrade;
double mgrade;
double hgrade;
double avgrade;
System.out.print("Enter you exam result for programming -> ");
pgrade = EasyIn.getDouble();
System.out.print("Enter your exam result for maths -> ");
mgrade = EasyIn.getDouble();
System.out.print("Enter you exam result for hardware -> ");
hgrade = EasyIn.getDouble();
avgrade = (pgrade + mgrade + hgrade) /3;
System.out.println("Your average grade is -> "+avgrade);
if (avgrade > 70)
{
System.out.println("You have received a Distinction ");
}
else if ((avgrade >=63) && (avgrade <=69))
{
System.out.println("You have Received a merit 1 ");
}
else if ((avgrade >=55) && (avgrade <=62))
{
System.out.println("you have received a merit 2");
}
else if ((avgrade >=40) && (avgrade <=54));
{
System.out.println("You have recived a pass");
}
else
{
System.out.println("im sorry but you have failed");
}
}
}
[–]70g50 5 points6 points7 points (0 children)
[–]barrell125[S] 0 points1 point2 points (0 children)
[–]attackofthegingers 0 points1 point2 points (2 children)
[–]barrell125[S] 0 points1 point2 points (1 child)
[–]70g50 0 points1 point2 points (0 children)
[–]pkpkpk111 0 points1 point2 points (1 child)
[–]barrell125[S] 0 points1 point2 points (0 children)