desislava_topuzakova

08. Cinema Ticket

Apr 17th, 2021
699
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class CinemaTickets_08 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         //ден от семицата -> String
  7.         //Monday, Tuesday, Friday -> 12
  8.             //dayOfWeek.equals("Monday")
  9.             //dayOfWeek.equals("Tuesday")
  10.             //dayOfWeek.equals("Friday")
  11.         //Wednesday, Thursday -> 14
  12.             //dayOfWeek.equals("Wednesday")
  13.             //dayOfWeek.equals("Thursday")
  14.         //Saturday, Sunday -> 16
  15.             //dayOfWeek.equals("Saturday")
  16.             //dayOfWeek.equals("Sunday")
  17.         String dayOfWeek = scanner.nextLine();
  18.         if (dayOfWeek.equals("Monday") || dayOfWeek.equals("Tuesday") || dayOfWeek.equals("Friday")) {
  19.             System.out.println(12);
  20.         } else if (dayOfWeek.equals("Wednesday") || dayOfWeek.equals("Thursday")) {
  21.             System.out.println(14);
  22.         } else if (dayOfWeek.equals("Saturday") || dayOfWeek.equals("Sunday")) {
  23.             System.out.println(16);
  24.         }
  25.  
  26.     }
  27. }
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.

×