Skip to content

Instantly share code, notes, and snippets.

@Exom9434
Created August 23, 2024 00:22
Show Gist options
  • Save Exom9434/56b1caa2725472b183a9c8fb2ff212c1 to your computer and use it in GitHub Desktop.
Save Exom9434/56b1caa2725472b183a9c8fb2ff212c1 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