1日目 段階8 小澤
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
@@ -39,25 +40,35 @@ public class Main {
|
||||
// System.out.println(employees[1].toCSV());
|
||||
// System.out.println(employees[1].getPrimaryKeyValue());
|
||||
|
||||
System.out.println("10002を検索します");
|
||||
Scanner sc = new Scanner(System.in);
|
||||
|
||||
System.out.println("検索したい社員IDを入力してください");
|
||||
String id = sc.nextLine();
|
||||
boolean result = false;
|
||||
for (int i = 0; i < employees.length; i++) {
|
||||
if (employees[i].isMatchId("10002")) {
|
||||
if (employees[i].isMatchId(id)) {
|
||||
result = true;
|
||||
employees[i].showInfo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(result==false) {
|
||||
System.out.println("該当する社員が見つかりませんでした");
|
||||
}
|
||||
System.out.println(result);
|
||||
|
||||
System.out.println("99999を検索します");
|
||||
result=false;
|
||||
for(int i=0;i<employees.length;i++) {
|
||||
if(employees[i].isMatchId("99999")) {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
System.out.println(result);
|
||||
|
||||
|
||||
// System.out.println("99999を検索します");
|
||||
// result = false;
|
||||
// for (int i = 0; i < employees.length; i++) {
|
||||
// if (employees[i].isMatchId("99999")) {
|
||||
// result = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// System.out.println(result);
|
||||
|
||||
//
|
||||
// }
|
||||
@@ -84,4 +95,4 @@ public class Main {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user