danisun18

Cinema

Jan 31st, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Cinema {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. String projection = scanner.nextLine();
  7. int rows = Integer.parseInt(scanner.nextLine());
  8. int columns = Integer.parseInt(scanner.nextLine());
  9.  
  10. double income = 0.0;
  11.  
  12. switch (projection) {
  13. case "Premiere":
  14. income = rows * columns * 12;
  15. break;
  16. case "Normal":
  17. income = rows * columns * 7.5;
  18. break;
  19. case "Discount":
  20. income = rows * columns * 5;
  21. break;
  22. }
  23. System.out.printf("%.2f", income);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment