一日目段階9完了しました

This commit is contained in:
2026-09-18 10:04:17 +09:00
parent 91689ca055
commit 5f46aaec08

View File

@@ -19,19 +19,22 @@ public class Main {
//
// System.out.println(employee[0].toCSV());
// System.out.println(employee[0].getPrimaryKeyValue());
System.out.println("検索したい社員IDを入力してください");
String str="";
while(!str.equals("0")){
System.out.println("検索したい社員IDを入力してください(終了する場合は0)");
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
for (int i = 0; i <= 4; i++) {
boolean bo = employee[i].isMatchId(str);
if (bo == true) {
System.out.println(employee[i]);
break;
}
if (bo == false && i == 4) {
System.out.println("該当する社員が見つかりませんでした");
str = sc.nextLine();
for (int i = 0; i <= 4; i++) {
boolean bo = employee[i].isMatchId(str);
if (bo == true) {
System.out.println(employee[i]);
break;
}
if (bo == false && i == 4 && !str.equals("0")) {
System.out.println("該当する社員が見つかりませんでした");
}
}
}
System.out.println("システムを終了します");
}
}