Skip to content

Instantly share code, notes, and snippets.

@codingchild2424
Created January 4, 2024 03:38
Show Gist options
  • Select an option

  • Save codingchild2424/4c2a21cf12e7ce77da4b0a6a395532a0 to your computer and use it in GitHub Desktop.

Select an option

Save codingchild2424/4c2a21cf12e7ce77da4b0a6a395532a0 to your computer and use it in GitHub Desktop.
JavaStudy01.java
import java.util.Scanner;
public class Main {
public static void main(String[] args){
String menu = "<<<[메뉴관리]>>>\n1. 회원관리\n2. 과목 관리\n3. 수강관리\n4. 결제 관리\n5. 종료";
while (true) {
System.out.println(menu);
Scanner in = new Scanner(System.in);
int c = in.nextInt();
System.out.println("출력" + c);
if (c==1) {
System.out.println("회원 관리 메뉴를 선택했습니다.");
}else if (c==2) {
System.out.println("과목 관리 메뉴를 선택했습니다.");
}else if (c==3) {
System.out.println("수강 관리 메뉴를 선택했습니다.");
}else if (c==4) {
System.out.println("결제 관리 메뉴를 선택했습니다.");
}else if (c==5) {
System.out.println("프로그램을 종료합니다.");
break;
} else {
System.out.println("입력값이 정확하지 않습니다.");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment