3日目段階5完了しました
This commit is contained in:
@@ -3,7 +3,7 @@ import java.util.Scanner;
|
|||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
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[0] = new EmployeeData("10000", "山田龍也", "ヤマダタツヤ", "yamada@hoge.jp", "aaa", "10");
|
||||||
employee[1] = new EmployeeData("10001", "高橋準", "タカハシジュン", "jtaka@hoge.jp", "bbb", "11");
|
employee[1] = new EmployeeData("10001", "高橋準", "タカハシジュン", "jtaka@hoge.jp", "bbb", "11");
|
||||||
@@ -25,12 +25,10 @@ public class Main {
|
|||||||
Scanner sc = new Scanner(System.in);
|
Scanner sc = new Scanner(System.in);
|
||||||
str = sc.nextLine();
|
str = sc.nextLine();
|
||||||
for (int i = 0; i <= 4; i++) {
|
for (int i = 0; i <= 4; i++) {
|
||||||
boolean bo = employee[i].isMatchId(str);
|
if (employee[i].getPrimaryKeyValue().equals(str)){
|
||||||
if (bo == true) {
|
|
||||||
System.out.println(employee[i]);
|
System.out.println(employee[i]);
|
||||||
break;
|
break;
|
||||||
}
|
} else if(!employee[i].getPrimaryKeyValue().equals(str) && i==4 && !str.equals("0")) {
|
||||||
if (bo == false && i == 4 && !str.equals("0")) {
|
|
||||||
System.out.println("該当する社員が見つかりませんでした");
|
System.out.println("該当する社員が見つかりませんでした");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user