revert 548e172d7d
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21"/>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/build/
|
||||
23
.project
23
.project
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>em-oop</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,9 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
|
||||
org.eclipse.jdt.core.compiler.compliance=21
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=21
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<installed facet="java" version="21"/>
|
||||
</faceted-project>
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
public class EmployeeData {
|
||||
|
||||
String idEmployee;
|
||||
String nmEmployee;
|
||||
String knEmployee;
|
||||
String mailAddress;
|
||||
String password;
|
||||
String idDepartment;
|
||||
|
||||
public void showInfo() {
|
||||
|
||||
System.out.println(this.idEmployee+"\t"
|
||||
+this.nmEmployee+"\t"
|
||||
+this.knEmployee+"\t"
|
||||
+this.mailAddress+"\t"
|
||||
+this.password+"\t"
|
||||
+this.idDepartment);
|
||||
|
||||
}
|
||||
|
||||
public boolean isMatchId( String id ) {
|
||||
return id.equals(this.idEmployee) ;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO 自動生成されたメソッド・スタブ
|
||||
|
||||
EmployeeData[] employees = new EmployeeData[5];
|
||||
|
||||
EmployeeData employee1 = new EmployeeData();
|
||||
employee1.idEmployee = "10000";
|
||||
employee1.nmEmployee = "山田龍也";
|
||||
employee1.knEmployee = "ヤマダタツヤ";
|
||||
employee1.mailAddress = "yamada@hoge.jp";
|
||||
employee1.password = "aaa";
|
||||
employee1.idDepartment = "10";
|
||||
employees[1-1] = employee1;
|
||||
|
||||
EmployeeData employee2 = new EmployeeData();
|
||||
employee2.idEmployee = "10001";
|
||||
employee2.nmEmployee = "高橋準";
|
||||
employee2.knEmployee = "タカハシジュン";
|
||||
employee2.mailAddress = "jtaka@hoge.jp";
|
||||
employee2.password = "bbb";
|
||||
employee2.idDepartment = "10";
|
||||
employees[2-1] = employee2;
|
||||
|
||||
EmployeeData employee3 = new EmployeeData();
|
||||
employee3.idEmployee = "10002";
|
||||
employee3.nmEmployee = "麻枝史明";
|
||||
employee3.knEmployee = "マエダフミアキ";
|
||||
employee3.mailAddress = "fmak@hoge.jp";
|
||||
employee3.password = "ccc";
|
||||
employee3.idDepartment = "11";
|
||||
employees[3-1] = employee3;
|
||||
|
||||
EmployeeData employee4 = new EmployeeData();
|
||||
employee4.idEmployee = "10003";
|
||||
employee4.nmEmployee = "丸戸章介";
|
||||
employee4.knEmployee = "マルトショウスケ";
|
||||
employee4.mailAddress = "marusyo@hoge.jp";
|
||||
employee4.password = "ddd";
|
||||
employee4.idDepartment = "12";
|
||||
employees[4-1] = employee4;
|
||||
|
||||
EmployeeData employee5 = new EmployeeData();
|
||||
employee5.idEmployee = "10004";
|
||||
employee5.nmEmployee = "三宅武";
|
||||
employee5.knEmployee = "ミヤケタケシ";
|
||||
employee5.mailAddress = "miya@hoge.jp";
|
||||
employee5.password = "eee";
|
||||
employee5.idDepartment = "13";
|
||||
employees[5-1] = employee5;
|
||||
|
||||
|
||||
//====================段階6====================
|
||||
for ( EmployeeData employee : employees ) {
|
||||
employee.showInfo();
|
||||
}
|
||||
|
||||
|
||||
//====================段階7====================
|
||||
// String id1 = "10002";
|
||||
// boolean matchId1 = false;
|
||||
// System.out.println(id1+" を検索します");
|
||||
// for ( EmployeeData employee : employees ) {
|
||||
// if ( employee.isMatchId(id1) ) {
|
||||
// matchId1 = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// System.out.println(matchId1);
|
||||
//
|
||||
// String id2 = "99999";
|
||||
// boolean matchId2 = false;
|
||||
// System.out.println(id2+" を検索します");
|
||||
// for ( EmployeeData employee : employees ) {
|
||||
// if ( employee.isMatchId(id2) ) {
|
||||
// matchId2 = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// System.out.println(matchId2);
|
||||
|
||||
|
||||
//====================段階8-9====================
|
||||
while (true) {
|
||||
|
||||
System.out.println("検索したい社員IDを入力してください(終了する場合は0)");
|
||||
Scanner sc = new Scanner(System.in);
|
||||
String id = sc.nextLine();
|
||||
|
||||
if ( id.equals("0") ) {
|
||||
System.out.println("システムを終了します");
|
||||
break;
|
||||
}
|
||||
|
||||
boolean matchId = false;
|
||||
for ( EmployeeData employee : employees ) {
|
||||
if ( employee.isMatchId(id) ) {
|
||||
matchId = true;
|
||||
employee.showInfo();
|
||||
//break;
|
||||
}
|
||||
}
|
||||
if ( matchId==false ) {
|
||||
System.out.println("該当する社員が見つかりませんでした");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user