Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package edu.hdsb.gwss.muir.ics3u.s2.u4;
- import java.util.Scanner;
- /**
- */
- public class SwitchCase {
- /**
- */
- public static void main(String[] args) {
- // VARIABLES
- String grade;
- // OBJECTS
- Scanner input = new Scanner(System.in);
- // ASK / GET
- System.out.println("Please enter your mark in Math (A, B, C, D, etc..) : ");
- grade = input.nextLine();
- switch (grade) {
- case "A":
- case "A+":
- case "A-":
- System.out.println("Your mark is between: 80-100%");
- break;
- case "B":
- case "B+":
- case "B-":
- System.out.println("Your mark is between: 70-79%");
- break;
- case "C":
- case "C+":
- case "C-":
- System.out.println("Your mark is between: 60-69%");
- break;
- case "D":
- case "D+":
- case "D-":
- System.out.println("Your mark is between: 50-59%");
- break;
- case "F":
- System.out.println("Your mark is below 50%");
- break;
- default:
- System.out.println("Sorry. I don't know that mark.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement