Write a Java program to calculate the grade of the student using the below criteria. Grade "Excellent": Marks>75 Grade "Satisfactory": 75>Marks>50 Grade "Needs Improvement": 50>Marks>40 Grade "Failing": Marks<40
this is actually extremely easy using a case statement... How much do you know about Java?
Just started taking a Java class in January. I can't get this program to work. Can U help?
post what you have please.
class Grade { public static void main(String args[]) { int A, B, C, D, F;
ok a few things. 1 it's String[] args 2. your grades aren't A-F Grade "Excellent": Marks>75 Grade "Satisfactory": 75>Marks>50 Grade "Needs Improvement": 50>Marks>40 Grade "Failing": Marks<40 They are "Excellent, Sat, etc. You need to do if statements. int mark; if(mark > 75) { system.out.println("Excellent"); } else if(.......) ...... ... ...
now does it work?
Yes it does..
Well good show me lad! Welcome to the programming world.
All I needed was to get pointed in the right direction. Thanks again!
Join our real-time social learning platform and learn together with your friends!