Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class number2 {
- public static void main(String[] args) {
- Scanner input = new Scanner (System.in);
- double mark;
- System.out.println("Mark obtained: ");
- mark = input.nextDouble();
- grade(mark);
- }
- public static void grade(double mark) {
- if(mark >= 90) {
- System.out.println("A");
- }
- else
- if(mark >= 80 && mark <= 89) {
- System.out.println("B");
- }
- else
- if(mark >= 70 && mark <= 79) {
- System.out.println("C");
- }
- else
- if(mark >= 60 && mark <= 69) {
- System.out.println("D");
- }
- else
- if(mark < 60) {
- System.out.println("F");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement