64 617
Assignments Done
99,1%
Successfully Done
In September 2018

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)
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions