Answer to Question #3537 in Java | JSP | JSF for Y mukundareddy
2011-07-13T16:38:41-04:00
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
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 !
Learn more about our help with Assignments:
Java JSP JSF
Comments
Leave a comment