Advertisement
DidiHristova93

Untitled

Jan 28th, 2019
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. import java.sql.SQLOutput;
  2. import java.util.Scanner;
  3.  
  4. public class techModuleTheatreProm {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. String day = scanner.nextLine();
  9. int age = Integer.parseInt(scanner.nextLine());
  10. int price = 0;
  11.  
  12.  
  13. if (age>= 0 && age<= 18) {
  14. if (day.equalsIgnoreCase("Weekday")) {
  15. price = 12;
  16. } else if (day.equalsIgnoreCase("Weekend")) {
  17. price = 15;
  18. } else if (day.equalsIgnoreCase("Holiday")) {
  19. price = 5;
  20. }
  21.  
  22. } else if (age > 18 && age <= 64) {
  23. if (day.equalsIgnoreCase("Weekday")) {
  24. price = 18;
  25. } else if (day.equalsIgnoreCase("Weekend")) {
  26. price = 20;
  27. } else if (day.equalsIgnoreCase("Holiday")) {
  28. price = 12;
  29. }
  30. } else if (age > 64 && age <= 122) {
  31. if (day.equalsIgnoreCase("Weekday")) {
  32. price = 12;
  33. } else if (day.equalsIgnoreCase("Weekend")) {
  34. price = 15;
  35. } else if (day.equalsIgnoreCase("Holiday")) {
  36. price = 10;
  37. }
  38.  
  39. } else {
  40. System.out.println("Error!");
  41. return;
  42.  
  43. }
  44. System.out.println(price+"$");
  45.  
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement