deyanivanov966

CONDITIONAL STATEMENTS ADVANCED - EXERCISE 01. Cinema

Aug 29th, 2020 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 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 A = scanner.nextLine();
  8.         int B = Integer.parseInt(scanner.nextLine());
  9.         int C = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double D = 0.00;
  12.  
  13.         if ("Premiere".equals(A)){
  14.             D=B*C*12;
  15.         }else if ("Normal".equals(A)){
  16.             D=B*C*7.5;
  17.         }else if ("Discount".equals(A)){
  18.             D=B*C*5;
  19.         }
  20.         System.out.printf("%.2f",D);
  21.  
  22.     }
  23. }
  24.  
Add Comment
Please, Sign In to add comment