package lab3;

import java.util.Scanner;

public class Example2 {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        System.out.print("Enter day of week: ");
        String day = in.nextLine().toLowerCase();

        // ===== Version 1: if-else =====
        if (day.equals("monday")) {
            System.out.println("1");
        } else if (day.equals("tuesday")) {
            System.out.println("2");
        } else if (day.equals("wednesday")) {
            System.out.println("3");
        } else if (day.equals("thursday")) {
            System.out.println("4");
        } else if (day.equals("friday")) {
            System.out.println("5");
        } else if (day.equals("saturday")) {
            System.out.println("6");
        } else if (day.equals("sunday")) {
            System.out.println("7");
        } else {
            System.out.println("No such day");
        }

        // ===== Version 2: switch =====
        switch (day) {
            case "monday":
                System.out.println("1");
                break;
            case "tuesday":
                System.out.println("2");
                break;
            case "wednesday":
                System.out.println("3");
                break;
            case "thursday":
                System.out.println("4");
                break;
            case "friday":
                System.out.println("5");
                break;
            case "saturday":
                System.out.println("6");
                break;
            case "sunday":
                System.out.println("7");
                break;
            default:
                System.out.println("No such day");
        }

        in.close();
    }
}
