Skip to content

Instantly share code, notes, and snippets.

@Exom9434
Last active May 25, 2024 06:33
Show Gist options
  • Save Exom9434/33da934349758ae2f639ec9c245d1337 to your computer and use it in GitHub Desktop.
Save Exom9434/33da934349758ae2f639ec9c245d1337 to your computer and use it in GitHub Desktop.
//노재경
import java.util.Scanner;
public class Main{
public static void main(String[] args){
int entrance = 0;
Scanner scanner = new Scanner(System.in);
System.out.println("[입장권 계산]");
System.out.print("나이를 입력해주세요 (숫자): ");
int age = scanner.nextInt();
System.out.print("입장시간을 입력해주세요. (숫자입력): ");
int time = scanner.nextInt();
scanner.nextLine();
System.out.print("국가유공자 여부를 입력해주세요 (y/n): ");
String isHonor = scanner.nextLine();
System.out.print("복지카드 여부를 입력해 주세요. (y/n): ");
String isCard = scanner.nextLine();
if(age < 3){
entrance = 0;
} else if(time>= 17 || age < 13){
entrance = 4000;
} else if(isHonor.equals("y") || isCard.equals("y")){
entrance = 8000;
} else{
entrance = 10000;
}
scanner.close();
System.out.println("입장료: " + entrance);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment