Advertisement
galinyotsev123

ProgBasicsJavaBook4.1ComplexConditions11Cinema

Jan 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 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. if (ticketType.equals("premiere")){
  13. total = columsCount * rowCount * 12;
  14. }
  15. else if (ticketType.equals("normal")){
  16. total = columsCount * rowCount * 7.50;
  17. }
  18. else if (ticketType.equals("discount")){
  19. total = columsCount * rowCount * 5;
  20. }
  21. System.out.printf("%.2f leva", total);
  22.  
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement