Advertisement
galinyotsev123

ProgBasicsJavaBook4.1ComplexConditions11Cinema2

Jan 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E11Cinema {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. String ticketType = scanner.nextLine().toLowerCase();
  8. int columsCount = Integer.parseInt(scanner.nextLine());
  9. int rowCount = Integer.parseInt(scanner.nextLine());
  10. double total = 0;
  11.  
  12. switch (ticketType) {
  13. case "premiere":
  14. total = columsCount * rowCount * 12;
  15. break;
  16. }
  17. switch (ticketType) {
  18. case "normal":
  19. total = columsCount * rowCount * 7.50;
  20. break;
  21. }
  22. switch (ticketType) {
  23. case "discount":
  24. total = columsCount * rowCount * 5;
  25. break;
  26. }
  27.  
  28. System.out.printf("%.2f leva", total);
  29.  
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement