From 6ca44e2bc8d2dfba6a87fdbc7af214d56d795a91 Mon Sep 17 00:00:00 2001 From: LuieR Date: Thu, 27 Jun 2024 13:28:46 -0400 Subject: [PATCH 1/4] chore:scaffolding school manager software completed, pending testings --- .DS_Store | Bin 0 -> 6148 bytes .idea/.gitignore | 3 + .idea/compiler.xml | 13 + .idea/encodings.xml | 7 + .idea/homework-java-ironschool.iml | 9 + .idea/jarRepositories.xml | 20 ++ .idea/misc.xml | 15 ++ .idea/modules.xml | 8 + .idea/vcs.xml | 6 + ironschool/pom.xml | 20 ++ ironschool/src/main/java/package1/Course.java | 71 +++++ .../src/main/java/package1/ICommands.java | 15 ++ ironschool/src/main/java/package1/Main.java | 249 ++++++++++++++++++ .../src/main/java/package1/Student.java | 71 +++++ .../src/main/java/package1/Teacher.java | 50 ++++ .../target/classes/package1/Course.class | Bin 0 -> 2330 bytes .../target/classes/package1/ICommands.class | Bin 0 -> 374 bytes ironschool/target/classes/package1/Main.class | Bin 0 -> 7638 bytes .../target/classes/package1/Student.class | Bin 0 -> 2385 bytes .../target/classes/package1/Teacher.class | Bin 0 -> 1823 bytes 20 files changed, 557 insertions(+) create mode 100644 .DS_Store create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/homework-java-ironschool.iml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 ironschool/pom.xml create mode 100644 ironschool/src/main/java/package1/Course.java create mode 100644 ironschool/src/main/java/package1/ICommands.java create mode 100644 ironschool/src/main/java/package1/Main.java create mode 100644 ironschool/src/main/java/package1/Student.java create mode 100644 ironschool/src/main/java/package1/Teacher.java create mode 100644 ironschool/target/classes/package1/Course.class create mode 100644 ironschool/target/classes/package1/ICommands.class create mode 100644 ironschool/target/classes/package1/Main.class create mode 100644 ironschool/target/classes/package1/Student.class create mode 100644 ironschool/target/classes/package1/Teacher.class diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cedb1e05314f56addc46a56e27e914da12a0488d GIT binary patch literal 6148 zcmeHKOHRW;41I=FDj=aQS>^fpFvT3_!~$DX-Q8#dUcQ}$!;oMg7zhS}fq%*XbGFL($T9k0AQ%V+z8KK^A!k!8 z6Sj_ab+EG%fS7UGgt|TbiMdV?%Y>~XXDH&KL=TlzVo0hS#KUPXlYi^z;Sk%I>!h7O zix)|ShveoCDIKE^27-Yu1N%OlX#QXDR~jtxyCE?O27-Y<#(-q=%lV9lO1X9Cc$#Z- xwktLj^=nn3P`6Y}v{cN2-XkYwbbGEk?PbE&QCHD<3n#`yzzB&h82AAOJ^%*;Plo^i literal 0 HcmV?d00001 diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..21cfa76 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..0c3156a --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/homework-java-ironschool.iml b/.idea/homework-java-ironschool.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/homework-java-ironschool.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7255851 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..7d98804 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ironschool/pom.xml b/ironschool/pom.xml new file mode 100644 index 0000000..85585de --- /dev/null +++ b/ironschool/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + package1 + ironschool + 1.0-SNAPSHOT + + + 17 + 17 + UTF-8 + + + + + + \ No newline at end of file diff --git a/ironschool/src/main/java/package1/Course.java b/ironschool/src/main/java/package1/Course.java new file mode 100644 index 0000000..dac2c56 --- /dev/null +++ b/ironschool/src/main/java/package1/Course.java @@ -0,0 +1,71 @@ +package package1; + +import java.util.UUID; + +public class Course { + private String courseId = UUID.randomUUID().toString().substring(0, 6); + private String name; + private double price; + private double money_earned; + private Teacher teacher; + + public Course(String name, double price) { + this.name = name; + this.price = price; + } + + public Course() { + } + + public String getCourseId() { + return courseId; + } + + public void setCourseId(String courseId) { + this.courseId = courseId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public double getMoney_earned() { + return money_earned; + } + + public void setMoney_earned(double money_earned) { + this.money_earned = money_earned; + } + + public Teacher getTeacher() { + return teacher; + } + + public void setTeacher(Teacher teacher) { + this.teacher = teacher; + } + + @Override + public String toString() { + return "Course{" + + "courseId='" + courseId + '\'' + + ", name='" + name + '\'' + + ", price=" + price + + ", money_earned=" + money_earned + + ", teacher=" + teacher + + '}'; + } + +} \ No newline at end of file diff --git a/ironschool/src/main/java/package1/ICommands.java b/ironschool/src/main/java/package1/ICommands.java new file mode 100644 index 0000000..db0447c --- /dev/null +++ b/ironschool/src/main/java/package1/ICommands.java @@ -0,0 +1,15 @@ +package package1; + +public interface ICommands { + + void enroll(String studentName, String courseName); + void assign(String teacherName, String courseName); + void showCourses(); + void lookUpCourse(String courseName); + void showStudents(); + void lookUpStudent(String studentName); + void showTeachers(); + void lookUpTeacher(String teacherName); + void showProfit(); + +} diff --git a/ironschool/src/main/java/package1/Main.java b/ironschool/src/main/java/package1/Main.java new file mode 100644 index 0000000..30da928 --- /dev/null +++ b/ironschool/src/main/java/package1/Main.java @@ -0,0 +1,249 @@ +package package1; + +import java.util.*; + +public class Main implements ICommands { + + private static Map teachersList = new HashMap<>(); + private static Map coursesList = new HashMap<>(); + private static Map studentsList = new HashMap<>(); + + public static void main(String[] args) { + Main main = new Main(); + Scanner scannerIn = new Scanner(System.in); + + System.out.println("Please enter name to create a School"); + String schoolName = scannerIn.nextLine(); + System.out.println("How many teachers?"); + int numberOfTeachers = scannerIn.nextInt(); + scannerIn.nextLine(); + + for (int i = 0; i < numberOfTeachers; i++) { + System.out.println("Enter teacher" + (i + 1) + " name"); + String teacherName = scannerIn.nextLine(); + System.out.println("Enter " + teacherName + "'s salary"); + double teacherSalary = scannerIn.nextDouble(); + scannerIn.nextLine(); + + Teacher teacher = new Teacher(teacherName, teacherSalary); + teachersList.put(teacher.getName(), teacher); + } + System.out.println(teachersList); + + System.out.println("Enter the amount of courses"); + int numberOfCourses = scannerIn.nextInt(); + scannerIn.nextLine(); + + for (int i = 0; i < numberOfCourses; i++) { + System.out.println("Enter course" + (i + 1) + " name"); + String courseName = scannerIn.nextLine().trim().toLowerCase(); + System.out.println("Enter course price"); + double coursePrice = scannerIn.nextDouble(); + scannerIn.nextLine(); + + Course course = new Course(courseName, coursePrice); + coursesList.put(course.getName(), course); + } + + System.out.println(coursesList); + + System.out.println("Enter how many students"); + int numberOfStudents = scannerIn.nextInt(); + scannerIn.nextLine(); + + for (int i = 0; i < numberOfStudents; i++) { + System.out.println("Enter student's name"); + String name = scannerIn.nextLine(); + System.out.println("Enter student's address"); + String address = scannerIn.nextLine(); + System.out.println("Enter student's email"); + String email = scannerIn.nextLine(); + + Student student = new Student(name, address, email); + studentsList.put(student.getName(), student); + } + + System.out.println(studentsList); + + while (true) { + System.out.println(""" + Enter a command: + 1) ENROLL a student to a course + 2) ASSIGN a teacher to a course + 3) SHOW COURSES + 4) LOOKUP COURSE + 5) SHOW STUDENTS + 6) LOOKUP STUDENT + 7) SHOW TEACHERS + 8) LOOKUP TEACHER + 9) SHOW PROFIT + 10) EXIT + """); + + do{ + //this we did in class + scannerIn = new Scanner(System.in); + System.out.print("Enter a command: "); + } + while(!scannerIn.hasNextInt()); + + int option = scannerIn.nextInt(); + scannerIn.nextLine(); + String name; + String course; + + switch (option) { + case 1: + System.out.println("Enter student name:"); + name = scannerIn.nextLine(); + System.out.println("Enter course name:"); + course = scannerIn.nextLine(); + main.enroll(name, course); + break; + case 2: + System.out.println("Enter teacher name:"); + name = scannerIn.nextLine(); + System.out.println("Enter course name:"); + course = scannerIn.nextLine(); + main.assign(name, course); + break; + case 3: + main.showCourses(); + break; + case 4: + System.out.println("Enter course name:"); + course = scannerIn.nextLine(); + try{ + main.lookUpCourse(course); + } catch (InputMismatchException e){ + System.out.println("Name is not properly formatted: "+ course); + } + + break; + case 5: + main.showStudents(); + break; + case 6: + System.out.println("Enter student name:"); + name = scannerIn.nextLine(); + main.lookUpStudent(name); + break; + case 7: + main.showTeachers(); + break; + case 8: + System.out.println("Enter teacher name:"); + name = scannerIn.nextLine(); + main.lookUpTeacher(name); + break; + case 9: + main.showProfit(); + break; + case 10: + System.out.println("Exiting the program."); + scannerIn.close(); + return; + default: + System.out.println("Invalid command."); + } + } + } + + @Override + public void enroll(String studentName, String courseName) { + Student student = studentsList.get(studentName); + Course course = coursesList.get(courseName.toLowerCase().trim()); + if (student != null && course != null) { + student.setCourse(course); + course.setMoney_earned(course.getMoney_earned() + course.getPrice()); + System.out.println("Student " + student.getName() + " enrolled in course " + course.getName()); + + } else { + System.out.println("Invalid student or course name"); + } + } + + + @Override + public void assign(String teacherName, String courseName) { + Teacher teacher = teachersList.get(teacherName); + Course course = coursesList.get(courseName); + if (teacher != null && course != null) { + course.setTeacher(teacher); + System.out.println("Teacher " + teacher.getName() + " assigned to course " + course.getName()); + } else { + System.out.println("Invalid teacher or course name"); + } + } + + @Override + public void showCourses() { + System.out.println("These are the Courses:"); + for (Course course : coursesList.values()) { + System.out.println(course); + } + } + + @Override + public void lookUpCourse(String courseName) { + String courseN = courseName.trim().toLowerCase(); + Course course = coursesList.get(courseN); + if (course != null) { + System.out.println("This is the course: "+course); + } else { + System.out.println("Course not found"); + } + } + + @Override + public void showStudents() { + System.out.println("The students are: "); + for (Student student : studentsList.values()) { + System.out.println(student); + } + } + + @Override + public void lookUpStudent(String studentName) { + Student student = studentsList.get(studentName); + if (student != null) { + System.out.println(student); + } else { + System.out.println("Student not found"); + } + } + + @Override + public void showTeachers() { + System.out.println("Teachers:"); + for (Teacher teacher : teachersList.values()) { + System.out.println(teacher); + } + } + + @Override + public void lookUpTeacher(String teacherName) { + Teacher teacher = teachersList.get(teacherName); + if (teacher != null) { + System.out.println(teacher); + } else { + System.out.println("Teacher not found"); + } + } + + @Override + public void showProfit() { + double totalEarnings = 0; + for (Course course : coursesList.values()) { + totalEarnings += course.getMoney_earned(); + } + + double totalSalaries = 0; + for (Teacher teacher : teachersList.values()) { + totalSalaries += teacher.getSalary(); + } + + double profit = totalEarnings - totalSalaries; + System.out.println("Total profit: " + profit); + } +} \ No newline at end of file diff --git a/ironschool/src/main/java/package1/Student.java b/ironschool/src/main/java/package1/Student.java new file mode 100644 index 0000000..9dfb5ba --- /dev/null +++ b/ironschool/src/main/java/package1/Student.java @@ -0,0 +1,71 @@ +package package1; + +import java.util.UUID; + +public class Student { + private String studentId = UUID.randomUUID().toString().substring(0, 6); + private String name; + private String address; + private String email; + private Course course; + + public Student(String name, String address, String email) { + this.name = name; + this.address = address; + this.email = email; + } + + public Student() { + } + + public String getStudentId() { + return studentId; + } + + public void setStudentId(String studentId) { + this.studentId = studentId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public Course getCourse() { + return course; + } + + public void setCourse(Course course) { + this.course = course; + } + + @Override + public String toString() { + return "Student{" + + "studentId='" + studentId + '\'' + + ", name='" + name + '\'' + + ", address='" + address + '\'' + + ", email='" + email + '\'' + + ", course=" + course + + '}'; + } +} \ No newline at end of file diff --git a/ironschool/src/main/java/package1/Teacher.java b/ironschool/src/main/java/package1/Teacher.java new file mode 100644 index 0000000..ac4cc6d --- /dev/null +++ b/ironschool/src/main/java/package1/Teacher.java @@ -0,0 +1,50 @@ +package package1; + +import java.util.UUID; + +public class Teacher { + private String teacherId = UUID.randomUUID().toString().substring(0, 6); //auto generated + private String name; + private double salary; + + public Teacher() { + } + + public Teacher(String name, double salary) { + this.name = name; + this.salary = salary; + } + + public String getTeacherId() { + return teacherId; + } + + public void setTeacherId(String teacherId) { + this.teacherId = teacherId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public double getSalary() { + return salary; + } + + public void setSalary(double salary) { + this.salary = salary; + } + + @Override + public String toString() { + return "Teacher{" + + "teacherId='" + teacherId + '\'' + + ", name='" + name + '\'' + + ", salary=" + salary + + '}'; + } +} \ No newline at end of file diff --git a/ironschool/target/classes/package1/Course.class b/ironschool/target/classes/package1/Course.class new file mode 100644 index 0000000000000000000000000000000000000000..7fd5397a9d268ad6e9b0db30fcf3829b6574a311 GIT binary patch literal 2330 zcmaJ@>r&fB6#mv1$ruHL3#QN-Ok(OwNLa9;RAfgkQwO4nSR1IYfXFTxSUWJzR>P6WF^{h_Z1DR!Z%^*eJT%sT<&H>n1>->K>RGyu z4Gs5jpJB1DpYf(`8M^nq>7A0~db;Jg44v{M#7Rx7H5osG8irg%xK`zeN^RO*DlF46 zExtGGA9LqGKkktx+p!J3cceR}I0wpvcWM&2x$CTw+&aV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D`XrpleBsBehW#Uq3Gx74s}jXBuojP!N2P?8p`J- zsAAy!gebnwO7sRtke_neeiO@ikm%$w;wJnYE~otc9ES=tTB_4Ev|%<|spNTxyQ11y z$wA))jD@_K&T^&5r%BD=T?ILeRWo@P)}YiP^ft!x8xae_jM80#yb?u(utED4n0Xej z^IY-MC(&5C+gG~Fh%rj0HH_6!%Rb1UnZ!AvLS4yKOU+VO@&5`kpADrJ=-);9cZvR8 brhixH-&OjzUjMF94Wx^arctd|8xa3LJm6^! literal 0 HcmV?d00001 diff --git a/ironschool/target/classes/package1/Student.class b/ironschool/target/classes/package1/Student.class new file mode 100644 index 0000000000000000000000000000000000000000..24e295e7ef353e31975c3ea3c3b8a7044ba4aaf6 GIT binary patch literal 2385 zcmbW3ZBr9h6vzKJA=xBd0mD!01SC~kTaBO+MAJrWi_#Z;bxH2P%4V0zZk%yC zo$1Hu$7pAYI=<)!=!fd`oV^Q4mclI7*S95Ton$eH*Arod>R-t#TH`r<`nOCZ;k zPTTG1L%zJ+99F2Y{iumCj0sb&yaOG!762?LWRrZ7E(c50UOdi!4J zV!GUDgy9CAWbr9x4a}MN44;#eW7#^A2kJ(3*YCBJL-}Pry=$}u@|rj5V8O%}Y(3)0 zj$)5jOk8DwA=~Y)@;sK6Ok87GN_C`Vvt-Fc8Ov0`mfP!kO5k$yEPOo>)$();D<)QP zU0|jok5t`tTGId7@(*d}`O@({flm26*GEdC05K&Kxbu-$*ElM!oFHCqZH39QL`QeH0#`K1cQ!$Jj-yo|Ux+dC@ zf!^gv_E6sxwJ3?t4jKB*Bfc+cN0NuzEJ^hR2~1FHMvKNx)7O|RpHpCv+%8>lOKn@6 zycs64#`8dJxaqn+b*?;qs{BK@?Tw}JD2Hu4Ht>Yop&?M}kD}$ga*q_XEKiH>kZsxW z-R^6FKL+a%Dr%=sXcTSbm71=5)H|+yuwjM_pT9m@cP(Gl zGWcF#GtB!}?{vu4m&DR)fd@(N!U@ucV083W&&;~`jf&TB9M!Gc(({yOU`OEEx!S~~ zY~Tlhg%7LJbn5!x3QcT+#xX^2`c}{`!BZcsH0;4j10Jk2*0f#%O*_`;U8U3S7@;4a zRCxKUT;dN8k^xORq(J5AGWv8ji->y7r-R$zz~97z%tt{MVnM!*2bqt8TqTg=1t8oG400zHq!0yJj0L$H4^oJNR0w3{ z0ua7=2C2n@6r&((u^{*2K?a&rU(HPdxpe^uHy(qmV}ss227^7a7zMc<3vwS1LgS$x zS&UZXE`ii80O5&b5ca=Fa;}$*Np-HD4?VjQpe#Gqml*P$n literal 0 HcmV?d00001 diff --git a/ironschool/target/classes/package1/Teacher.class b/ironschool/target/classes/package1/Teacher.class new file mode 100644 index 0000000000000000000000000000000000000000..18e799bee4b00d65c5701813cdb6f7bd946d562d GIT binary patch literal 1823 zcmaJ?T~pge6g`WLg%HSXz zm_@m<+8cLh>-cFGGnf^aio>0F=mm!Yb7!7OX0uD*GOjzAb1{#~7`3yoVl>*1EJUTz z?b>u{kRoni(ZPEzZsL7{oXGyMJX8-_yGr(t)KH)p8>@RDP&Rxo11!6!>gaqR2TCK} za&a4Xs7)k&IeaA`w#wA=u8R*)7g!j`W7P?RzKnnH;v-s7EQ2@_c-Xj_;p)y-Mj_1J z2@jOOOwS9{v(aE*4R__f&z*8F>`Q-74n4iLoB8<2W5ROpa>Z?dN(PIq)ja|CP{mdl zEr%P8E$1`BbdO^I@|CsVO=ck=+rG@B7-{0|K)t@@Pv>*E zQ5W^Knw~XdnIYQ{KU1V`5U63tmrg7X^Ja8sU@ka zHVr|OdNk*%KFO?4;68m#JuQCqZ1GD=adSG)H?BlOd?B{iQLR2@^Lnir3;-5kt&JQ-a3R^(15kza;r=Ba@;gPOulRh8$6S?Yb?_~RdGSAcT4N0W literal 0 HcmV?d00001 From 7f16a45a4636bb6669df1271dc14ce74da74e7dc Mon Sep 17 00:00:00 2001 From: LuieR Date: Thu, 27 Jun 2024 13:36:14 -0400 Subject: [PATCH 2/4] chore: add dependencies for testing --- ironschool/pom.xml | 7 ++++++- ironschool/src/test/java/package1/MainTest.java | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 ironschool/src/test/java/package1/MainTest.java diff --git a/ironschool/pom.xml b/ironschool/pom.xml index 85585de..738afa8 100644 --- a/ironschool/pom.xml +++ b/ironschool/pom.xml @@ -14,7 +14,12 @@ UTF-8 - + + org.junit.jupiter + junit-jupiter-api + 5.11.0-M2 + test + \ No newline at end of file diff --git a/ironschool/src/test/java/package1/MainTest.java b/ironschool/src/test/java/package1/MainTest.java new file mode 100644 index 0000000..25b0573 --- /dev/null +++ b/ironschool/src/test/java/package1/MainTest.java @@ -0,0 +1,4 @@ +import static org.junit.jupiter.api.Assertions.*; +class MainTest { + +} \ No newline at end of file From 7b59e6beb2e4dd503b3d45954cad3f574b749fba Mon Sep 17 00:00:00 2001 From: LuieR Date: Thu, 27 Jun 2024 13:40:35 -0400 Subject: [PATCH 3/4] chore: Implement tetsing for Main class --- .../src/test/java/package1/MainTest.java | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/ironschool/src/test/java/package1/MainTest.java b/ironschool/src/test/java/package1/MainTest.java index 25b0573..437ab85 100644 --- a/ironschool/src/test/java/package1/MainTest.java +++ b/ironschool/src/test/java/package1/MainTest.java @@ -1,4 +1,37 @@ +package package1; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import static org.junit.jupiter.api.Assertions.*; class MainTest { - + + static Course course1; + static Teacher teacher1; + static Student student1; + + @BeforeAll + static void beforeAll() { + course1 = new Course("Math", 300); + teacher1 = new Teacher("Gabriel", 1000); + student1 = new Student("luie", "3476 Wonderland St.", "luie@example.com"); + } + + @Test + void main() { + + + System.out.println(course1.getCourseId().getClass()); + + System.out.println(teacher1); + student1.setCourse(course1); + System.out.println("This is the student with course: "+student1); + System.out.println(student1.getCourse()); + + } } \ No newline at end of file From 0ecbeb953233f8b5652ed68b7ba5828e2d8f453e Mon Sep 17 00:00:00 2001 From: LuieR Date: Thu, 27 Jun 2024 13:42:26 -0400 Subject: [PATCH 4/4] implemented testing for Main class --- .../target/test-classes/package1/MainTest.class | Bin 0 -> 1883 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ironschool/target/test-classes/package1/MainTest.class diff --git a/ironschool/target/test-classes/package1/MainTest.class b/ironschool/target/test-classes/package1/MainTest.class new file mode 100644 index 0000000000000000000000000000000000000000..ddd9be191715aa7a9251f5cb927a096384d2fee6 GIT binary patch literal 1883 zcmaJ>ZBr9h6n<`q*(I)m5kVZmK+zIQ*;1`mg9^l=v_Y*&L#chc*<6z)o88RrjV=8X z{o21#nSmLZ>GX4dRHx_eZr%zl6ZYPF?z!hY=Q%Hb{r&C_01x1%k-&(Cq=7R?F^uo= zH{5i%TQ{Fq_k<-GQmeLW%ZCgji@AyhonfrattPLF6|>-V{6OePGbFdUY^2uwKglkT zhKBRX<`~1|VzFu=SfD7Kj!p62V7Pee_T4+#9nY-^pZKa}OLAGqB0W?pYvO0#YCB@t@>*%k;ilr^ z1BQF2aB-5Ilah$84-G8CB=|uDX&8QtGe3$Ie5~P?f!p|GD5a(SK#CS+((4ermm)W| zXTG4ENXm@ht-Q+IT?3!u9>dwXkP+QmHHL}B+(}@ne)0xZ@ql0{b%zH5u`{F_3d!;# ztZ7&`uz>=pgheszopRS!SR9w&4N?^qV?I|=WPWB~6HgdMgDyM;uAj%aLUNT1Wq-@S z=lFtQs>Pe4;JFr;JGN}lE|A=ng!RV2(=LanM*0Zb3j4EvVT(&T!uGWQv}}oeKADb&iEe*{~I_{V2O_k|$?X@!Ipn zy5lfRzwEfuZi$K=*z|nebv?D#uY@J-&f&5iDJvXyL6`!QVo z4^`Eeq?ImFXIf&@R)EiSp)9MEQpIg}o(!bV+uK4myjn1p0#Bm~OG8bigWfFkM}qCX z@tVSnXpAzn$t~&m`wYJg7D22S8GTAU=ZIjT=y}afJAbk=2P8ue%lmC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