1日目 9段階目 小澤
This commit is contained in:
@@ -42,22 +42,29 @@ public class Main {
|
||||
|
||||
Scanner sc = new Scanner(System.in);
|
||||
|
||||
System.out.println("検索したい社員IDを入力してください");
|
||||
|
||||
for (int i = 0; i < employees.length; i++) {
|
||||
System.out.println("検索したい社員IDを入力してください(終了する場合は0)");
|
||||
String id = sc.nextLine();
|
||||
boolean result = false;
|
||||
for (int i = 0; i < employees.length; i++) {
|
||||
|
||||
if(id.equals("0")) {
|
||||
System.out.println("システムを終了します");
|
||||
break;
|
||||
}
|
||||
if (employees[i].isMatchId(id)) {
|
||||
result = true;
|
||||
employees[i].showInfo();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(result==false) {
|
||||
System.out.println("該当する社員が見つかりませんでした");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// System.out.println("99999を検索します");
|
||||
|
||||
Reference in New Issue
Block a user