desislava_topuzakova

02. Weekend or Working Day

Apr 17th, 2021
584
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         //ден от седмицата -> text
  7.         //Monday, Tuesday, Wednesday, Thursday, Friday -> Working day
  8.         //Saturday, Sunday -> Weekend
  9.         //other -> Error
  10.         String dayOfWeek = scanner.nextLine();
  11.         switch (dayOfWeek) {
  12.             case "Monday":
  13.             case "Tuesday":
  14.             case "Wednesday":
  15.             case "Thursday":
  16.             case "Friday":
  17.                 System.out.println("Working day");
  18.                 break;
  19.             case "Saturday":
  20.             case "Sunday":
  21.                 System.out.println("Weekend");
  22.                 break;
  23.             default:
  24.                 System.out.println("Error");
  25.                 break;
  26.         }
  27.     }
  28. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×