Advertisement
Ivakis

Cinema

Aug 18th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4. public static void main(String[] args) {
  5.  
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. String type = scanner.nextLine();
  9. int r = Integer.parseInt(scanner.nextLine());
  10. int c = Integer.parseInt(scanner.nextLine());
  11.  
  12. double seats = r * c;
  13.  
  14. double ticket = 0.0;
  15.  
  16. if(type.equals("Premiere")){
  17. ticket = 12.00;
  18. }else if(type.equals("Normal")){
  19. ticket = 7.50;
  20. }else if(type.equals("Discount")){
  21. ticket = 5.0;
  22. }
  23.  
  24. double result = seats * ticket;
  25.  
  26. System.out.printf("%.2f", result);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement