diff --git a/misson1014/.classpath b/misson1014/.classpath
new file mode 100644
index 0000000..463d5f9
--- /dev/null
+++ b/misson1014/.classpath
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/misson1014/.project b/misson1014/.project
new file mode 100644
index 0000000..8da7352
--- /dev/null
+++ b/misson1014/.project
@@ -0,0 +1,17 @@
+
+
+ misson1014
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/misson1014/.settings/org.eclipse.core.resources.prefs b/misson1014/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/misson1014/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/=UTF-8
diff --git a/misson1014/.settings/org.eclipse.jdt.core.prefs b/misson1014/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..9a7984b
--- /dev/null
+++ b/misson1014/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=21
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=21
diff --git a/misson1014/bin/misson1014/BaseData.class b/misson1014/bin/misson1014/BaseData.class
new file mode 100644
index 0000000..64b9538
Binary files /dev/null and b/misson1014/bin/misson1014/BaseData.class differ
diff --git a/misson1014/bin/misson1014/BasicCheck1.class b/misson1014/bin/misson1014/BasicCheck1.class
new file mode 100644
index 0000000..0a5cdc2
Binary files /dev/null and b/misson1014/bin/misson1014/BasicCheck1.class differ
diff --git a/misson1014/bin/misson1014/BasicCheck2.class b/misson1014/bin/misson1014/BasicCheck2.class
new file mode 100644
index 0000000..0a5aac0
Binary files /dev/null and b/misson1014/bin/misson1014/BasicCheck2.class differ
diff --git a/misson1014/bin/misson1014/BasicCheck3.class b/misson1014/bin/misson1014/BasicCheck3.class
new file mode 100644
index 0000000..5c2127c
Binary files /dev/null and b/misson1014/bin/misson1014/BasicCheck3.class differ
diff --git a/misson1014/bin/misson1014/Book.class b/misson1014/bin/misson1014/Book.class
new file mode 100644
index 0000000..ad27760
Binary files /dev/null and b/misson1014/bin/misson1014/Book.class differ
diff --git a/misson1014/bin/misson1014/Circle.class b/misson1014/bin/misson1014/Circle.class
new file mode 100644
index 0000000..6be598b
Binary files /dev/null and b/misson1014/bin/misson1014/Circle.class differ
diff --git a/misson1014/bin/misson1014/Day3Check1.class b/misson1014/bin/misson1014/Day3Check1.class
new file mode 100644
index 0000000..25bd9d7
Binary files /dev/null and b/misson1014/bin/misson1014/Day3Check1.class differ
diff --git a/misson1014/bin/misson1014/DepartmentData.class b/misson1014/bin/misson1014/DepartmentData.class
new file mode 100644
index 0000000..ea216be
Binary files /dev/null and b/misson1014/bin/misson1014/DepartmentData.class differ
diff --git a/misson1014/bin/misson1014/EmployeeData.class b/misson1014/bin/misson1014/EmployeeData.class
new file mode 100644
index 0000000..6e1039f
Binary files /dev/null and b/misson1014/bin/misson1014/EmployeeData.class differ
diff --git a/misson1014/bin/misson1014/Item.class b/misson1014/bin/misson1014/Item.class
new file mode 100644
index 0000000..8572ad9
Binary files /dev/null and b/misson1014/bin/misson1014/Item.class differ
diff --git a/misson1014/bin/misson1014/Main.class b/misson1014/bin/misson1014/Main.class
new file mode 100644
index 0000000..abd03f6
Binary files /dev/null and b/misson1014/bin/misson1014/Main.class differ
diff --git a/misson1014/bin/misson1014/Main1.class b/misson1014/bin/misson1014/Main1.class
new file mode 100644
index 0000000..4b5f024
Binary files /dev/null and b/misson1014/bin/misson1014/Main1.class differ
diff --git a/misson1014/bin/misson1014/Shape.class b/misson1014/bin/misson1014/Shape.class
new file mode 100644
index 0000000..4a0f46d
Binary files /dev/null and b/misson1014/bin/misson1014/Shape.class differ
diff --git a/misson1014/bin/misson1014/Student.class b/misson1014/bin/misson1014/Student.class
new file mode 100644
index 0000000..a67a786
Binary files /dev/null and b/misson1014/bin/misson1014/Student.class differ
diff --git a/misson1014/src/misson1014/BaseData.java b/misson1014/src/misson1014/BaseData.java
new file mode 100644
index 0000000..5674b0a
--- /dev/null
+++ b/misson1014/src/misson1014/BaseData.java
@@ -0,0 +1,10 @@
+package misson1014;
+
+public abstract class BaseData {
+
+ public abstract String toString();
+
+ public abstract String toCSV();
+
+ public abstract String getPrimaryKeyValue();
+}
diff --git a/misson1014/src/misson1014/BasicCheck1.java b/misson1014/src/misson1014/BasicCheck1.java
new file mode 100644
index 0000000..670dabd
--- /dev/null
+++ b/misson1014/src/misson1014/BasicCheck1.java
@@ -0,0 +1,27 @@
+package misson1014;
+
+public class BasicCheck1 {
+
+ public static void main(String[] args) {
+ // TODO 自動生成されたメソッド・スタブ
+ //コンストラクタ
+ Book book1 = new Book();
+
+ //book1
+ System.out.println(book1.title);
+ System.out.println(book1.author);
+ System.out.println(book1.price);
+
+ //コンストラクタ
+ Book book2 = new Book(
+ "銀河鉄道の夜",
+ "宮沢賢治",
+ 500);
+
+ //book2
+ System.out.println(book2.title);
+ System.out.println(book2.author);
+ System.out.println(book2.price);
+
+ }
+}
diff --git a/misson1014/src/misson1014/BasicCheck2.java b/misson1014/src/misson1014/BasicCheck2.java
new file mode 100644
index 0000000..29c4ebc
--- /dev/null
+++ b/misson1014/src/misson1014/BasicCheck2.java
@@ -0,0 +1,23 @@
+package misson1014;
+
+public class BasicCheck2 {
+
+ public static void main(String[] args) {
+ // TODO 自動生成されたメソッド・スタブ
+ Student student1 = new Student(1, "鈴木一郎");
+ Student student2 = new Student(2, "田中花子");
+ Student student3 = new Student(3, "佐藤次郎");
+
+ // 学生情報表示
+ student1.printProfile();
+ student2.printProfile();
+ student3.printProfile();
+
+ // 現在の学生数表示
+ System.out.println(
+ "現在の生徒数:"
+ + Student.getStudentCount()
+ + "人");
+ }
+
+}
diff --git a/misson1014/src/misson1014/BasicCheck3.java b/misson1014/src/misson1014/BasicCheck3.java
new file mode 100644
index 0000000..d788fa5
--- /dev/null
+++ b/misson1014/src/misson1014/BasicCheck3.java
@@ -0,0 +1,37 @@
+package misson1014;
+
+public class BasicCheck3 {
+
+ public static void main(String[] args) {
+ // TODO 自動生成されたメソッド・スタブ
+ // Item型の配列を作成
+ Item[] items = new Item[3];
+
+ //インスタンス生成
+ items[0] = new Item();
+ items[1] = new Item();
+ items[2] = new Item();
+
+ items[0].setName("ノート");
+ items[0].setPrice(120);
+ items[0].setStock(50);
+
+ items[1].setName("消しゴム");
+ items[1].setPrice(80);
+ items[1].setStock(30);
+
+ items[2].setName("鉛筆");
+ items[2].setPrice(60);
+ items[2].setStock(100);
+
+ //販売
+ for (int i = 0; i < items.length; i++) {
+ items[i].sell(5);
+ }
+ //商品情報表示
+ for (int i = 0; i < items.length; i++) {
+ System.out.println(items[i]);
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/misson1014/src/misson1014/Book.java b/misson1014/src/misson1014/Book.java
new file mode 100644
index 0000000..c9c8743
--- /dev/null
+++ b/misson1014/src/misson1014/Book.java
@@ -0,0 +1,28 @@
+package misson1014;
+
+public class Book {
+ // タイトル
+ String title;
+ // 著者
+ String author;
+ // 価格
+ int price;
+
+ //コンストラクタ
+ public Book() {
+
+ this.title = "タイトル未設定";
+ this.author = "著者未設定";
+ this.price = 0;
+ }
+
+ //コンストラクタ
+ public Book(String title, String author, int price) {
+
+ //フィールド代入
+ this.title = title;
+ this.author = author;
+ this.price = price;
+
+ }
+}
diff --git a/misson1014/src/misson1014/Circle.java b/misson1014/src/misson1014/Circle.java
new file mode 100644
index 0000000..ad797b1
--- /dev/null
+++ b/misson1014/src/misson1014/Circle.java
@@ -0,0 +1,24 @@
+package misson1014;
+
+public class Circle extends Shape {
+
+ private double radius;
+
+ public Circle(double radius) {
+
+ super("円");
+
+ this.radius = radius;
+ }
+
+ @Override
+ public double area() {
+ return Math.PI * this.radius * this.radius;
+ }
+
+ @Override
+ public void showInfo() {
+ super.showInfo();
+ System.out.println("(半径:" + this.radius + ")");
+ }
+}
\ No newline at end of file
diff --git a/misson1014/src/misson1014/Day3Check1.java b/misson1014/src/misson1014/Day3Check1.java
new file mode 100644
index 0000000..b40a2aa
--- /dev/null
+++ b/misson1014/src/misson1014/Day3Check1.java
@@ -0,0 +1,11 @@
+package misson1014;
+
+public class Day3Check1 {
+
+ public static void main(String[] args) {
+ // TODO 自動生成されたメソッド・スタブ
+ Circle circle = new Circle(2);
+
+ circle.showInfo();
+ }
+}
diff --git a/misson1014/src/misson1014/DepartmentData.java b/misson1014/src/misson1014/DepartmentData.java
new file mode 100644
index 0000000..0effde0
--- /dev/null
+++ b/misson1014/src/misson1014/DepartmentData.java
@@ -0,0 +1,38 @@
+package misson1014;
+
+public class DepartmentData extends BaseData {
+
+ private String idDepartment;
+ private String nmDepartment;
+
+ public String getIdDepartment() {
+ return idDepartment;
+ }
+
+ public void setIdDepartment(String idDepartment) {
+ this.idDepartment = idDepartment;
+ }
+
+ public String getNmDepartment() {
+ return nmDepartment;
+ }
+
+ public void setNmDepartment(String nmDepartment) {
+ this.nmDepartment = nmDepartment;
+ }
+
+ @Override
+ public String toString() {
+ return getIdDepartment() + "\t" + getNmDepartment();
+ }
+
+ @Override
+ public String toCSV() {
+ return getIdDepartment() + "," + getNmDepartment();
+ }
+
+ @Override
+ public String getPrimaryKeyValue() {
+ return getIdDepartment();
+ }
+}
diff --git a/misson1014/src/misson1014/EmployeeData.java b/misson1014/src/misson1014/EmployeeData.java
new file mode 100644
index 0000000..eef4eb6
--- /dev/null
+++ b/misson1014/src/misson1014/EmployeeData.java
@@ -0,0 +1,147 @@
+package misson1014;
+
+public class EmployeeData extends BaseData {
+ //社員ID
+ private String idEmployee;
+ //社員名
+ private String nmEmployee;
+ //社員名カナ
+ private String knEmployee;
+ //メールアドレス
+ private String mailAddress;
+ //パスワード
+ private String password;
+ //部署ID
+ private String idDepartment;
+ //社員データ件数
+ private static int empCount = 0;
+ //コンストラクタ
+ public EmployeeData() {
+ empCount++;
+ }
+ //コンストラクタ
+ public EmployeeData(
+ String idEmployee,
+ String nmEmployee,
+ String knEmployee,
+ String mailAddress,
+ String password,
+ String idDepartment) {
+
+ this.setIdEmployee(idEmployee);
+ this.setNmEmployee(nmEmployee);
+ this.setKnEmployee(knEmployee);
+ this.setMailAddress(mailAddress);
+ this.setPassword(password);
+ this.setIdDepartment(idDepartment);
+
+ empCount++;
+ }
+
+ //ゲッター
+ public String getIdEmployee() {
+ return idEmployee;
+ }
+ public String getNmEmployee() {
+ return nmEmployee;
+ }
+ public String getKnEmployee() {
+ return knEmployee;
+ }
+ public String getMailAddress() {
+ return mailAddress;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public String getIdDepartment() {
+ return idDepartment;
+ }
+ //セッター
+ public void setIdEmployee(String idEmployee) {
+
+ if (idEmployee == null) {
+ System.out.println("社員IDが空のため設定できませんでした");
+ return;
+ }
+
+ if (idEmployee.trim().isEmpty()) {
+ System.out.println("社員IDが空のため設定できませんでした");
+ return;
+ }
+
+ this.idEmployee = idEmployee;
+ }
+
+ public void setNmEmployee(String nmEmployee) {
+
+ if (nmEmployee == null) {
+ System.out.println("社員名が空のため設定できませんでした");
+ return;
+ }
+
+ if (nmEmployee.trim().isEmpty()) {
+ System.out.println("社員名が空のため設定できませんでした");
+ return;
+ }
+
+ this.nmEmployee = nmEmployee;
+ }
+
+ public void setKnEmployee(String knEmployee) {
+ this.knEmployee = knEmployee;
+ }
+
+ public void setMailAddress(String mailAddress) {
+ this.mailAddress = mailAddress;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public void setIdDepartment(String idDepartment) {
+ this.idDepartment = idDepartment;
+ }
+
+ //toString
+ @Override
+ public String toString() {
+
+ return getIdEmployee() + "\t"
+ + getNmEmployee() + "\t"
+ + getKnEmployee() + "\t"
+ + getMailAddress() + "\t"
+ + getPassword() + "\t"
+ + getIdDepartment();
+ }
+
+ //CSV形式へ変換
+ @Override
+ public String toCSV() {
+
+ return getIdEmployee() + ","
+ + getNmEmployee() + ","
+ + getKnEmployee() + ","
+ + getMailAddress() + ","
+ + getPassword() + ","
+ + getIdDepartment();
+ }
+
+ //キー取得
+ @Override
+ public String getPrimaryKeyValue() {
+
+ return getIdEmployee();
+ }
+
+ //ID一致判定
+ public boolean isMatchId(String id) {
+ return getIdEmployee().equals(id);
+ }
+
+ //件数取得
+ public static int getEmpCount() {
+ return empCount;
+ }
+}
\ No newline at end of file
diff --git a/misson1014/src/misson1014/Item.java b/misson1014/src/misson1014/Item.java
new file mode 100644
index 0000000..462c658
--- /dev/null
+++ b/misson1014/src/misson1014/Item.java
@@ -0,0 +1,52 @@
+package misson1014;
+
+public class Item {
+ private String name;
+ private int price;
+ private int stock;
+
+ //商品
+ public void sell(int amount) {
+ //在庫減らし
+ this.setStock(this.getStock() - amount);
+ }
+
+ //商品名ゲッター
+ public String getName() {
+ return name;
+ }
+ //商品名セッター
+ public void setName(String name) {
+ this.name = name;
+ }
+ //価格ゲッター
+ public int getPrice() {
+ return price;
+ }
+ //価格セッター
+ public void setPrice(int price) {
+ this.price = price;
+ }
+ //在庫数ゲッター
+ public int getStock() {
+ return stock;
+ }
+ //在庫数セッター
+ public void setStock(int stock) {
+ this.stock = stock;
+ }
+
+ @Override
+ public String toString() {
+
+ return getName()
+ + " "
+ + getPrice()
+ + "円 (残り"
+ + getStock()
+ + "個)";
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/misson1014/src/misson1014/Main.java b/misson1014/src/misson1014/Main.java
new file mode 100644
index 0000000..04b9a2f
--- /dev/null
+++ b/misson1014/src/misson1014/Main.java
@@ -0,0 +1,241 @@
+package misson1014;
+import java.util.Scanner;
+
+public class Main {
+
+ public static void main(String[] args) {
+ // TODO 自動生成されたメソッド・スタブ
+ //社員データ格納用配列作成
+ //EmployeeDataをBaseDataとして管理する
+ //(ポリモーフィズム)
+ BaseData[] employees = new BaseData[5];
+
+ //社員データ用インスタンス
+ employees[0] = new EmployeeData();
+ employees[1] = new EmployeeData();
+ employees[2] = new EmployeeData();
+ employees[3] = new EmployeeData();
+ employees[4] = new EmployeeData();
+ employees[0] = new EmployeeData();
+ employees[1] = new EmployeeData();
+ employees[2] = new EmployeeData();
+ employees[3] = new EmployeeData();
+ employees[4] = new EmployeeData();
+
+ //社員情報設定
+ //BaseData型なのでEmployeeDataへ
+ //キャストしてセッターを利用する
+ ((EmployeeData) employees[0]).setIdEmployee("10000");
+ ((EmployeeData) employees[0]).setNmEmployee("山田龍也");
+ ((EmployeeData) employees[0]).setKnEmployee("ヤマダタツヤ");
+ ((EmployeeData) employees[0]).setMailAddress("yamada@hoge.jp");
+ ((EmployeeData) employees[0]).setPassword("aaa");
+ ((EmployeeData) employees[0]).setIdDepartment("10");
+
+ ((EmployeeData) employees[1]).setIdEmployee("10001");
+ ((EmployeeData) employees[1]).setNmEmployee("高橋準");
+ ((EmployeeData) employees[1]).setKnEmployee("タカハシジュン");
+ ((EmployeeData) employees[1]).setMailAddress("jtaka@hoge.jp");
+ ((EmployeeData) employees[1]).setPassword("bbb");
+ ((EmployeeData) employees[1]).setIdDepartment("10");
+
+ ((EmployeeData) employees[2]).setIdEmployee("10002");
+ ((EmployeeData) employees[2]).setNmEmployee("麻枝史明");
+ ((EmployeeData) employees[2]).setKnEmployee("マエダフミアキ");
+ ((EmployeeData) employees[2]).setMailAddress("fmak@hoge.jp");
+ ((EmployeeData) employees[2]).setPassword("ccc");
+ ((EmployeeData) employees[2]).setIdDepartment("11");
+
+ ((EmployeeData) employees[3]).setIdEmployee("10003");
+ ((EmployeeData) employees[3]).setNmEmployee("丸戸章介");
+ ((EmployeeData) employees[3]).setKnEmployee("マルトショウスケ");
+ ((EmployeeData) employees[3]).setMailAddress("marusyo@hoge.jp");
+ ((EmployeeData) employees[3]).setPassword("ddd");
+ ((EmployeeData) employees[3]).setIdDepartment("12");
+
+ ((EmployeeData) employees[4]).setIdEmployee("10004");
+ ((EmployeeData) employees[4]).setNmEmployee("三宅武");
+ ((EmployeeData) employees[4]).setKnEmployee("ミヤケタケシ");
+ ((EmployeeData) employees[4]).setMailAddress("miya@hoge.jp");
+ ((EmployeeData) employees[4]).setPassword("eee");
+ ((EmployeeData) employees[4]).setIdDepartment("13");
+
+ //6段階目
+ //EmployeeDataとDepartmentDataを同じBaseData配列で管理する
+ //全データ格納用
+ BaseData[] allData = new BaseData[11];
+
+ //社員データをallDataへ格納
+ for (int i = 0; i < employees.length; i++) {
+ allData[i] = employees[i];
+ }
+
+ //部署データ作成
+ //先にDepartmentData型で生成
+ //値を設定後にallDataへ格納する
+ DepartmentData dept;
+
+ dept = new DepartmentData();
+ dept.setIdDepartment("10");
+ dept.setNmDepartment("役員");
+ allData[5] = dept;
+
+ dept = new DepartmentData();
+ dept.setIdDepartment("11");
+ dept.setNmDepartment("人事・総務部");
+ allData[6] = dept;
+
+ dept = new DepartmentData();
+ dept.setIdDepartment("12");
+ dept.setNmDepartment("経理部");
+ allData[7] = dept;
+
+ dept = new DepartmentData();
+ dept.setIdDepartment("13");
+ dept.setNmDepartment("システム開発事業部");
+ allData[8] = dept;
+
+ dept = new DepartmentData();
+ dept.setIdDepartment("14");
+ dept.setNmDepartment("教育事業部");
+ allData[9] = dept;
+
+ dept = new DepartmentData();
+ dept.setIdDepartment("15");
+ dept.setNmDepartment("営業企画部");
+ allData[10] = dept;
+
+ //BaseData配列を全件表示
+ //EmployeeDataとDepartmentDataでオーバーライドされたtoString()が実行
+ for (int i = 0; i < allData.length; i++) {
+ System.out.println(allData[i]);
+ }
+
+ //7段階目
+ //instanceofを使って型を判定
+ //EmployeeData件数とDepartmentData件数を集計
+ int employeeCount = 0;
+ int departmentCount = 0;
+
+ for (int i = 0; i < allData.length; i++) {
+
+ if (allData[i] instanceof EmployeeData) {
+ employeeCount++;
+ }
+
+ if (allData[i] instanceof DepartmentData) {
+ departmentCount++;
+ }
+ }
+
+ //集計結果表示
+ System.out.println("社員データ:" + employeeCount + "件");
+ System.out.println("部署データ:" + departmentCount + "件");
+
+
+ //8段階目
+ //EmployeeDataへキャストしてメールアドレスを取得する
+ for (int i = 0; i < allData.length; i++) {
+
+ if (allData[i] instanceof EmployeeData) {
+
+ EmployeeData employee = (EmployeeData) allData[i];
+
+ System.out.println(
+ employee.getMailAddress()
+ );
+ }
+ }
+
+ Scanner scanner = new Scanner(System.in);
+
+ //9段階目
+ //入力した部署名に所属する社員を検索
+ //部署名から部署IDを取得
+ //部署IDと一致する社員を検索
+ //社員名とメールアドレスを表示
+
+ System.out.println("検索したい部署名を入力してください");
+ String departmentName = scanner.nextLine();
+
+ //該当部署の部署ID
+ String targetDepartmentId = null;
+
+ //部署見つかったか
+ boolean departmentFound = false;
+
+ //部署検索
+ for (int i = 0; i < allData.length; i++) {
+
+ if (allData[i] instanceof DepartmentData) {
+ DepartmentData department =(DepartmentData) allData[i];
+ if (department.getNmDepartment().equals(departmentName)) {
+ targetDepartmentId = department.getIdDepartment();
+ departmentFound = true;
+
+ break;
+ }
+ }
+ }
+
+ //部署が存在した場合
+ if (departmentFound) {
+
+ System.out.println("所属社員一覧");
+ for (int i = 0; i < allData.length; i++) {
+ if (allData[i] instanceof EmployeeData) {
+ EmployeeData employee =(EmployeeData) allData[i];
+ if (employee.getIdDepartment().equals(targetDepartmentId)) {
+ System.out.println(employee.getNmEmployee()
+ + "\t"
+ + employee.getMailAddress()
+ );
+ }
+ }
+ }
+
+ } else {
+
+ System.out.println(
+ "該当する部署が見つかりませんでした");
+
+ }
+
+
+
+ //三日目4段階目用
+ //System.out.println(employees[0].toCSV());
+ //System.out.println(employees[0].getPrimaryKeyValue());
+
+ //検索機能
+ //ループ
+ while (true) {
+
+ System.out.println("検索したい社員IDを入力してください(終了する場合は0)");
+
+ String search = scanner.nextLine();
+
+ if (search.equals("0")) {
+ System.out.println("システムを終了します");
+ break;
+ }
+
+ boolean found = false;
+
+ //ID検索と比較
+ for (int i = 0; i < employees.length; i++) {
+ if (employees[i].getPrimaryKeyValue().equals(search)) {
+ System.out.println(employees[i]);
+ found = true;
+ break;
+ }
+ }
+ //該当なし
+ if (!found) {
+ System.out.println("該当する社員が見つかりませんでした");
+ }
+ }
+
+ scanner.close();
+ }
+}
\ No newline at end of file
diff --git a/misson1014/src/misson1014/Main1.java b/misson1014/src/misson1014/Main1.java
new file mode 100644
index 0000000..35f57bd
--- /dev/null
+++ b/misson1014/src/misson1014/Main1.java
@@ -0,0 +1,125 @@
+package misson1014;
+
+public class Main1 {
+
+ public static void main(String[] args) {
+ // TODO 自動生成されたメソッド・スタブ
+ //8段階目まで
+
+ /*
+ EmployeeData[] employees = new EmployeeData[5];
+
+ employees[0] = new EmployeeData();
+ employees[1] = new EmployeeData();
+ employees[2] = new EmployeeData();
+ employees[3] = new EmployeeData();
+ employees[4] = new EmployeeData();
+
+ employees[0].setIdEmployee("10000");
+
+ 8段階用
+ employees[0].setNmEmployee("");
+
+ employees[0].setKnEmployee("ヤマダタツヤ");
+ employees[0].setMailAddress("yamada@hoge.jp");
+ employees[0].setPassword("aaa");
+ employees[0].setIdDepartment("10");
+
+ employees[1].setIdEmployee("10001");
+ employees[1].setNmEmployee("高橋準");
+ employees[1].setKnEmployee("タカハシジュン");
+ employees[1].setMailAddress("jtaka@hoge.jp");
+ employees[1].setPassword("bbb");
+ employees[1].setIdDepartment("10");
+
+ employees[2].setIdEmployee("10002");
+ employees[2].setNmEmployee("麻枝史明");
+ employees[2].setKnEmployee("マエダフミアキ");
+ employees[2].setMailAddress("fmak@hoge.jp");
+ employees[2].setPassword("ccc");
+ employees[2].setIdDepartment("11");
+
+ employees[3].setIdEmployee("10003");
+ employees[3].setNmEmployee("丸戸章介");
+ employees[3].setKnEmployee("マルトショウスケ");
+ employees[3].setMailAddress("marusyo@hoge.jp");
+ employees[3].setPassword("ddd");
+ employees[3].setIdDepartment("12");
+
+ employees[4].setIdEmployee("10004");
+ employees[4].setNmEmployee("三宅武");
+ employees[4].setKnEmployee("ミヤケタケシ");
+ employees[4].setMailAddress("miya@hoge.jp");
+ employees[4].setPassword("eee");
+ employees[4].setIdDepartment("13");
+
+ for (int i = 0; i < employees.length; i++) {
+
+ System.out.println(employees[i]);
+
+ }
+
+ System.out.println(
+ "現在の社員データ件数:"
+ + EmployeeData.getEmpCount()
+ + "件");
+ */
+
+ /*ここから9段階↓
+ EmployeeData employee1 =
+ new EmployeeData(
+ "10000",
+ "",
+ "ヤマダタツヤ",
+ "yamada@hoge.jp",
+ "aaa",
+ "10"
+ );
+
+ EmployeeData employee2 =
+ new EmployeeData(
+ "",
+ "山田龍也",
+ "ヤマダタツヤ",
+ "yamada@hoge.jp",
+ "aaa",
+ "10"
+ );
+ */
+
+ //三日目5段階
+ BaseData employee1 = new EmployeeData(
+ "10000",
+ "",
+ "ヤマダタツヤ",
+ "yamada@hoge.jp",
+ "aaa",
+ "10"
+ );
+
+ BaseData employee2 = new EmployeeData(
+ "",
+ "山田龍也",
+ "ヤマダタツヤ",
+ "yamada@hoge.jp",
+ "aaa",
+ "10"
+ );
+
+ System.out.println(employee1);
+
+ System.out.println(employee1.toCSV());
+
+ System.out.println(employee1.getPrimaryKeyValue());
+
+ System.out.println(
+ employee1.getPrimaryKeyValue().equals("10000")
+ );
+
+ System.out.println(
+ employee2.getPrimaryKeyValue().equals("10000")
+ );
+
+ }
+
+}
\ No newline at end of file
diff --git a/misson1014/src/misson1014/Shape.java b/misson1014/src/misson1014/Shape.java
new file mode 100644
index 0000000..79e901c
--- /dev/null
+++ b/misson1014/src/misson1014/Shape.java
@@ -0,0 +1,17 @@
+package misson1014;
+
+public class Shape {
+ private String name;
+
+ public Shape(String name) {
+ this.name = name;
+ }
+
+ public double area() {
+ return 0.0;
+ }
+
+ public void showInfo() {
+ System.out.println(this.name + "の面積は" + this.area() + "です");
+ }
+}
\ No newline at end of file
diff --git a/misson1014/src/misson1014/Student.java b/misson1014/src/misson1014/Student.java
new file mode 100644
index 0000000..2d783f3
--- /dev/null
+++ b/misson1014/src/misson1014/Student.java
@@ -0,0 +1,31 @@
+package misson1014;
+
+public class Student {
+ int studentId;
+ String name;
+ //staticフィールド
+ static int studentCount = 0;
+
+ //コンストラクタ
+ public Student(int studentId, String name) {
+ //フィールド代入
+ this.studentId = studentId;
+ this.name = name;
+ studentCount++;
+ }
+
+ //学生情報
+ void printProfile() {
+
+ System.out.println(
+ "学籍番号:" + this.studentId
+ + " 名前:" + this.name);
+ }
+
+ //現在の学生数用staticメソッド
+ public static int getStudentCount() {
+ return studentCount;
+
+ }
+
+}
\ No newline at end of file