3日目段階5完了しました

This commit is contained in:
2026-09-18 11:07:24 +09:00
parent 8c1fba011a
commit 4217c89629

View File

@@ -3,7 +3,7 @@ import java.util.Scanner;
public class Main {
public static void main(String[] args) {
EmployeeData[] employee = new EmployeeData[5];
BaseDate[] employee = new BaseDate[5];
employee[0] = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ", "yamada@hoge.jp", "aaa", "10");
employee[1] = new EmployeeData("10001", "高橋準", "タカハシジュン", "jtaka@hoge.jp", "bbb", "11");
@@ -25,16 +25,14 @@ public class Main {
Scanner sc = new Scanner(System.in);
str = sc.nextLine();
for (int i = 0; i <= 4; i++) {
boolean bo = employee[i].isMatchId(str);
if (bo == true) {
if (employee[i].getPrimaryKeyValue().equals(str)){
System.out.println(employee[i]);
break;
}
if (bo == false && i == 4 && !str.equals("0")) {
} else if(!employee[i].getPrimaryKeyValue().equals(str) && i==4 && !str.equals("0")) {
System.out.println("該当する社員が見つかりませんでした");
}
}
}
System.out.println("システムを終了します");
}
}
}