Advertisement
paykova

Cinema

Oct 6th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 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.  
  7. String type = scanner.nextLine();
  8. int numR = Integer.parseInt(scanner.nextLine());
  9. int numC = Integer.parseInt(scanner.nextLine());
  10. double ticketPrice, result;
  11.  
  12. if (type.equals("Premiere")) {
  13. ticketPrice = (numC*numR)*12.00;
  14. System.out.printf("%.2f%nleva", ticketPrice);
  15. } else if (type.equals("Normal")) {
  16. ticketPrice = (numC*numR)*7.50;
  17. System.out.printf("%.2f%nleva", ticketPrice);
  18. } else if (type.equals("Discount")) {
  19. ticketPrice = (numC*numR)*5.00;
  20. System.out.printf("%.2f leva", ticketPrice);
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement