Guest User

Untitled

a guest
Jan 31st, 2018
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. package LogicTwo;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Cinema {
  6.     public static void main(String[] args) {
  7.         Scanner scan = new Scanner(System.in);
  8.         String project = String.valueOf(scan.nextLine());
  9.         int rows = Integer.valueOf(scan.nextLine());
  10.         int col = Integer.valueOf(scan.nextLine());
  11.  
  12.         int tickets = rows * col;//Не е нужно да е double
  13.         double total = 0;
  14.         switch (project){
  15.             case "Premiere"://трябва да е с главна буква както е във входа
  16.                 total = tickets * 12;
  17.                 break;
  18.             case "Normal"://входа е "Normal" ,а ти проверяваш за "normal"
  19.                 total = tickets * 7.50;
  20.                 break;
  21.             case "Discount"://входа е "Discount" ,а ти проверяваш за "discount"
  22.                 total = tickets * 5.00;
  23.         }
  24.         System.out.printf("%.2f leva", total);//може и на един  ред
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment