Stept 9 done
This commit is contained in:
@@ -66,27 +66,36 @@ public class Main {
|
|||||||
// System.out.println(employee.mailAddress);
|
// System.out.println(employee.mailAddress);
|
||||||
// System.out.println(employee.password);
|
// System.out.println(employee.password);
|
||||||
// System.out.println(employee.idDepartment);
|
// System.out.println(employee.idDepartment);
|
||||||
|
|
||||||
//stept 8
|
|
||||||
Scanner scan = new Scanner(System.in);
|
Scanner scan = new Scanner(System.in);
|
||||||
System.out.println("検索したい社員IDを入力してください");
|
while (true) {
|
||||||
String serchId = scan.nextLine();
|
System.out.println("検索したい社員IDを入力してください(終了する場合は0)");
|
||||||
|
|
||||||
boolean found = false; //←if it haven't this boolean , they can't be decided true or false, so we should be make boolan name (found)
|
//stept 8
|
||||||
for (int i =0; i< employees.length; i++) {
|
|
||||||
if (employees[i].isMatchId(serchId)){
|
//System.out.println("検索したい社員IDを入力してください");
|
||||||
employees[i].showInfo();
|
String serchId = scan.nextLine();
|
||||||
found = true;
|
|
||||||
|
if (serchId.equals("0")) { //stept 9
|
||||||
|
System.out.println("システムを終了します");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean found = false; //←if it haven't this boolean , they can't be decided true or false, so we should be make boolan name (found)
|
||||||
|
for (int i = 0; i < employees.length; i++) {
|
||||||
|
if (employees[i].isMatchId(serchId)) {
|
||||||
|
employees[i].showInfo();
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!found) {
|
if (!found) {
|
||||||
System.out.println("該当する社員が見つかりませんでした");
|
System.out.println("該当する社員が見つかりませんでした");
|
||||||
}
|
}
|
||||||
scan.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scan.close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user