diff --git a/.idea/modules.xml b/.idea/modules.xml index 3aa439a..1687a9f 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -4,6 +4,7 @@ + diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..e96534f --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Week4/Week4.iml b/Week4/Week4.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Week4/Week4.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Week4/src/Class5/Employee.java b/Week4/src/Class5/Employee.java new file mode 100644 index 0000000..15ede66 --- /dev/null +++ b/Week4/src/Class5/Employee.java @@ -0,0 +1,64 @@ +package Class5; + +/** + * @author : 张宇轩 + * @createTime : 2022/9/21 - 9:10 + */ +public class Employee { + private String id; + private String name; + private String department; + private Float baseSalary; + + public Employee() { + } + + public Employee(String id, String name, String department, Float baseSalary) { + this.id = id; + this.name = name; + this.department = department; + this.baseSalary = baseSalary; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public Float getBaseSalary() { + return baseSalary; + } + + public void setBaseSalary(Float baseSalary) { + this.baseSalary = baseSalary; + } + + @Override + public String toString() { + return "Class5.Employee{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + ", department='" + department + '\'' + + ", baseSalary=" + baseSalary + + '}'; + } +} diff --git a/Week4/src/Class5/work/Rectangle.java b/Week4/src/Class5/work/Rectangle.java new file mode 100644 index 0000000..510acd3 --- /dev/null +++ b/Week4/src/Class5/work/Rectangle.java @@ -0,0 +1,28 @@ +package Class5.work; + +/** + * @author : 张宇轩 + * @createTime : 2022/9/21 - 9:17 + */ +public class Rectangle { + private Double length; + private Double width; + + public Rectangle() { + this.length = 1.0; + this.width = 1.0; + } + + public Rectangle(Double length, Double width) { + this.length = length; + this.width = width; + } + + public double calculateArea(){ + return length*width; + } + + public double calculatePerimeter(){ + return (length+width)*2; + } +} diff --git a/Week4/src/Class5/work/RectangleTest.java b/Week4/src/Class5/work/RectangleTest.java new file mode 100644 index 0000000..3fd15af --- /dev/null +++ b/Week4/src/Class5/work/RectangleTest.java @@ -0,0 +1,13 @@ +package Class5.work; + +/** + * @author : 张宇轩 + * @createTime : 2022/9/21 - 9:20 + */ +public class RectangleTest { + public static void main(String[] args) { + Rectangle rectangle = new Rectangle(3.0,4.0); + System.out.println("矩形的面积:" + rectangle.calculateArea()); + System.out.println("矩形的周长:" + rectangle.calculatePerimeter()); + } +} diff --git a/Week4/src/Class5/work/Student.java b/Week4/src/Class5/work/Student.java new file mode 100644 index 0000000..4b100d9 --- /dev/null +++ b/Week4/src/Class5/work/Student.java @@ -0,0 +1,30 @@ +package Class5.work; + +/** + * @author : 张宇轩 + * @createTime : 2022/9/21 - 9:14 + */ +public class Student { + private String name; + private String phoneNumber; + private String studentNumber; + + public Student(String name, String phoneNumber, String studentNumber) { + this.name = name; + this.phoneNumber = phoneNumber; + this.studentNumber = studentNumber; + } + + @Override + public String toString() { + return "Student{" + + "name='" + name + '\'' + + ", phoneNumber='" + phoneNumber + '\'' + + ", studentNumber='" + studentNumber + '\'' + + '}'; + } + + public void displayStudent(){ + System.out.println(this.toString()); + } +} diff --git a/Week4/src/Class5/work/StudentTest.java b/Week4/src/Class5/work/StudentTest.java new file mode 100644 index 0000000..24b5f52 --- /dev/null +++ b/Week4/src/Class5/work/StudentTest.java @@ -0,0 +1,12 @@ +package Class5.work; + +/** + * @author : 张宇轩 + * @createTime : 2022/9/21 - 9:17 + */ +public class StudentTest { + public static void main(String[] args) { + Student admin = new Student("admin", "123456", "123456"); + admin.displayStudent(); + } +} diff --git a/out/production/Week4/Class5/Employee.class b/out/production/Week4/Class5/Employee.class new file mode 100644 index 0000000..de75de7 Binary files /dev/null and b/out/production/Week4/Class5/Employee.class differ diff --git a/out/production/Week4/Class5/work/Rectangle.class b/out/production/Week4/Class5/work/Rectangle.class new file mode 100644 index 0000000..150b358 Binary files /dev/null and b/out/production/Week4/Class5/work/Rectangle.class differ diff --git a/out/production/Week4/Class5/work/RectangleTest.class b/out/production/Week4/Class5/work/RectangleTest.class new file mode 100644 index 0000000..41a0402 Binary files /dev/null and b/out/production/Week4/Class5/work/RectangleTest.class differ diff --git a/out/production/Week4/Class5/work/Student.class b/out/production/Week4/Class5/work/Student.class new file mode 100644 index 0000000..a69986b Binary files /dev/null and b/out/production/Week4/Class5/work/Student.class differ diff --git a/out/production/Week4/Class5/work/StudentTest.class b/out/production/Week4/Class5/work/StudentTest.class new file mode 100644 index 0000000..64c7c5a Binary files /dev/null and b/out/production/Week4/Class5/work/StudentTest.class differ