Skip to content

Instantly share code, notes, and snippets.

@zhyunk
Created March 3, 2023 13:31
Show Gist options
  • Select an option

  • Save zhyunk/7b919f50328f7bfb2e9cb0aadf13ceba to your computer and use it in GitHub Desktop.

Select an option

Save zhyunk/7b919f50328f7bfb2e9cb0aadf13ceba to your computer and use it in GitHub Desktop.
깜짝 과제1 . 수강 관리 프로그램 작성을 위한 메뉴 기능 구현
import java.util.Scanner;
/*
* 과제 9 : 깜짝 과제1 . 수강 관리 프로그램 작성을 위한 메뉴 기능 구현
*
* 작성자 : 김지현
* 작성일 : 2023-03-03
* */
public class MiniAssignment09 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int choice;
boolean isStop = false;
String title = "<<<<[메뉴선택]>>>>";
String menu = "1. 회원 관리\n2. 과목 관리\n3. 수강 관리\n4. 결제 관리\n5. 종료";
while (!isStop) {
System.out.println(title);
System.out.println(menu);
choice = scan.nextInt();
switch (choice) {
case 1:
System.out.println("회원 관리 메뉴를 선택했습니다.");
break;
case 2:
System.out.println("과목 관리 메뉴를 선택했습니다.");
break;
case 3:
System.out.println("수강 관리 메뉴를 선택했습니다.");
break;
case 4:
System.out.println("결제 관리 메뉴를 선택했습니다.");
break;
case 5 :
System.out.println("프로그램을 종료합니다.");
isStop = true;
break;
default:
System.out.println("입력값이 정확하지 않습니다.");
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment