Advertisement
Spocoman

08. Cinema Ticket

Aug 25th, 2024
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class  CinemaTicket {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         String day = scanner.nextLine();
  7.        
  8.         int price = switch (day) {
  9.             case "Monday", "Tuesday", "Friday" -> 12;
  10.             case "Wednesday", "Thursday" -> 14;
  11.             case "Saturday", "Sunday" -> 16;
  12.             default -> 0;
  13.         };
  14.  
  15.         System.out.println(price);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement