Answer to Question #3537 in Java | JSP | JSF for Y mukundareddy

Question #3537
4. Write a program to check which grade the student got marks. If student A marks=300, Student B Marks=450 and Student C Marks=550. (Grades 550 marks==A grade, 450 marks== B grade 300 marks==C grade)
1
Expert's answer
2012-03-16T09:13:19-0400
import java.util.Scanner;




public class Main {




public static void main(String[] args) {

int n;

String mark = null;

Scanner in = new Scanner(System.in);

System.out.print("Enter the number: ");

n = in.nextInt();

if(n == 550)

mark = "A";

else if(n < 550 && n >= 450)

mark = "B";

else if(n < 450 && n >= 300)

mark = "C";

System.out.println("Mark is " + mark);

}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS