Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.SQLOutput;
- import java.util.Scanner;
- public class techModuleTheatreProm {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String day = scanner.nextLine();
- int age = Integer.parseInt(scanner.nextLine());
- int price = 0;
- if (age>= 0 && age<= 18) {
- if (day.equalsIgnoreCase("Weekday")) {
- price = 12;
- } else if (day.equalsIgnoreCase("Weekend")) {
- price = 15;
- } else if (day.equalsIgnoreCase("Holiday")) {
- price = 5;
- }
- } else if (age > 18 && age <= 64) {
- if (day.equalsIgnoreCase("Weekday")) {
- price = 18;
- } else if (day.equalsIgnoreCase("Weekend")) {
- price = 20;
- } else if (day.equalsIgnoreCase("Holiday")) {
- price = 12;
- }
- } else if (age > 64 && age <= 122) {
- if (day.equalsIgnoreCase("Weekday")) {
- price = 12;
- } else if (day.equalsIgnoreCase("Weekend")) {
- price = 15;
- } else if (day.equalsIgnoreCase("Holiday")) {
- price = 10;
- }
- } else {
- System.out.println("Error!");
- return;
- }
- System.out.println(price+"$");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement