Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA JAVA JAVA JAVA JAVA JAVA NEED HELLP Do this Please : In School Control : - Create method saveSchool to Save the School in

JAVA JAVA JAVA JAVA JAVA JAVA NEED HELLP

Do this Please : In School Control :

- Create method saveSchool to Save the School in file school.json: - Create method importSchool to Import the School from school.json:

JAVA JAVA JAVA JAVA JAVA JAVA package school.control;

import school.model.Admin; import school.model.Instructor; import school.model.SClass; import school.model.School;

import java.util.List;

public class SchoolControl { private School school;

public SchoolControl(School school) { this.school = school; }

public School getSchool() { return school; }

public void setSchool(School school) { this.school = school; }

public void setAdmin(Admin admin) { school.setAdmin(admin); }

public void addSClass(SClass sClass) { List levelSClasses = school.getsClasses().get(sClass.getLevel()); char schoolClassSection = 'a'; schoolClassSection += levelSClasses.size(); sClass.setSection(schoolClassSection); levelSClasses.add(sClass);

}

public void setAdmin(School admin) { this.school = admin; }

public void addInstructor(Instructor instructor) { school.getInstructors().add(instructor); } }

************************************************************

package school.model;

import org.json.simple.JSONObject;

import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.logging.Level;

public class School { private Admin admin; private ArrayList instructors; private static Map> sClasses = new HashMap();

public School(Admin admin, ArrayList instructors) { this.admin = admin; this.instructors = instructors;

}

public Admin getAdmin() { return admin; }

public void setAdmin(Admin admin) { this.admin = admin; }

public ArrayList getInstructors() { return instructors; }

public void setInstructors(ArrayList instructors) { this.instructors = instructors; }

public static Map> getsClasses() { return sClasses; }

public void setsClasses(Map> sClasses) { this.sClasses = sClasses; }

enum level { FIRST, SECOND, THIRD, FORTH, FIFTH, SIXTH, SEVENTH, EIGHTH, NINTH, TENTH, ELEVENTH, TWELVETH; }

public void jsonSchool(){ JSONObject object = new JSONObject(); object.put("Admin",admin.getId()); object.put("sClasses",getsClasses());

}

}

******

package school.model;

import org.json.simple.JSONObject;

import java.util.ArrayList; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Level;

public class SClass {

private AtomicInteger id; private int roomNumber; private ArrayList

table; private ArrayList books; private ArrayList student; private ArrayList lecture; private String classManager; private Student mangerAssistance; private char section; private static Level level; private Student StudentsMarks;

public static AtomicInteger counter = new AtomicInteger(1);

public SClass(AtomicInteger id, int roomNumber, ArrayList

table, ArrayList books, ArrayList student, ArrayList lecture, String classManager, Student mangerAssistance, char section, Level level, Student studentsMarks) { this.id = id; this.roomNumber = roomNumber; this.table = table; this.books = books; this.student = student; this.lecture = lecture; this.classManager = classManager; this.mangerAssistance = mangerAssistance; this.section = section; this.level = level; this.StudentsMarks = studentsMarks;

} public void jsonSClass(){ JSONObject object = new JSONObject(); object.put("id",8); object.put("roomNumber",6); object.put("table",table); object.put("books",books); object.put("student",student); object.put("lecture",lecture); object.put("classManager",classManager); object.put("mangerAssistance",mangerAssistance); object.put("section",'c'); object.put("level",3); object.put("StudentsMarks ",StudentsMarks);

}

public SClass(AtomicInteger id) { this.id = id; }

public int getId() { return counter.incrementAndGet(); }

public void setId(AtomicInteger id) { this.id = id; }

public int getRoomNumber() { return roomNumber; }

public void setRoomNumber(int roomNumber) { this.roomNumber = roomNumber; }

public ArrayList

getTable() { return table; }

public void setTable(ArrayList

table) { this.table = table; }

public ArrayList getBooks() { return books; }

public void setBooks(ArrayList books) { this.books = books; }

public ArrayList getStudent() { return student; }

public void setStudent(ArrayList student) { this.student = student; }

public ArrayList getLecture() { return lecture; }

public void setLecture(ArrayList lecture) { this.lecture = lecture; }

public String getClassManager() { return classManager; }

public void setClassManager(String classManager) { this.classManager = classManager; }

public Student getMangerAssistance() { return mangerAssistance; }

public void setMangerAssistance(Student mangerAssistance) { this.mangerAssistance = mangerAssistance; }

public void setSection(char section) { this.section = section; }

public Student getStudentsMarks() { return StudentsMarks; }

public void setStudentsMarks(Student studentsMarks) { StudentsMarks = studentsMarks; }

public char getSection() { return section; }

public static Level getLevel() { return level; }

public void setLevel(Level level) { this.level = level; } }image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

} Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Studentjava school sc school model) Student getStudent Marks Tester - #Cil: Gilgan Q Project - SClassjava x Studentjava X Lecture.java X School.java Instructor jawa x Lecture, java x Period.java x MODEL JELLY LIULUI EWELILCYC school Development NetBear A7 A 18 v 54 return "Student (" + 13 super(id, name, dateOfBirth, gender); > idea 55 "id=" + getId + 14 this.lecture = lecture; > .metadata 15 56 ", name='" getName()+ '\" + } 57 dateatbirth=" + getdateOfBirth() + 16 >nbproject 58 gender=" + getGender() + 17 public Lecture getLectures() { return lecture; } SIC v school 59 *, Sclass=" + getsClass(+ 20 Vb control 6D 21 public void setlectures (lecture lectures) { this.lecture = 1.6 SchoolControl 61 24 poverride SClass control 25 of public String toString() { v model public void setsClass(sclass sClass) { this.sclass = sClass; } 26 return "Instructor (" + VD Test 66 - 27 id=" + getId(). Tester 67 public List getstudentsMarks() { return students Marks; } 28 name=' + getName() + '\"' + Admin 70 29 *, dateOfBirth=" + getDateOfBirth() + Ecok 71 public void setStudents Marks(List students Marks) { this.studentsMar 30 gender=" + getGendero Instructor 31 - sclass." getLectures : Lecture 75 public void setStudentNarks(Nap studentMarks) { this.stu 32 > Period 33 } > Person public void sonstudent public void jsonInstructor of > School SD JSONDbject object = new JSONObject(). 35 JSONDbject object = new JSONObject(); SClass 81 object.put("id", 8); object.put("id", 1002); Student object.put("Name", "yahya"); 37 object.put("name", "Willian"); 83 object.put("dateOfBirth", 101 / 2 / 27); 38 object.put("dateOfBirth", 87/6/30); test object.put("Gender", Gender. Male); 39 object.put("gender", Gender Male), .classpath 85 project object.put("SClass", sClass.getId(); build.xml 86 41 manifesti 87 } 42 schoolimi SB v lilli External Libraries C:\Program Fileslava > Inlijson-simple-1.1.1 BScratches and Consoles c C lable TODO 0 Problems 2 Terminal a Frent log 41:30 CRL UIF-8 4 spac.. master 2 9:47 AM AO D 40 ENG 2/19/2021 Type here to search OBE 07 Tesler #CC 5 Da A 11 A Eile Edit View Navigate Code Analyze Befactor fuild Run Tools Git Vindow Help School - Lecturejava school c school model Lecture Lecture Project I - sclass.javax Lecture jawa x school Development NetBea 1 package school.model; > idea 2 > .metadata 3 import org.json.simple.JSONObject; 4 >nbproject 5 import java.util.concurrent.atonic.Atomic Integer; SIC 6 v school 7 public class Lecture ( vb control 8 private AtonicInteger id; SchoolControl 9 private String name; SClass Control 10 private Sclass sClass; v model 11 private Book book; VD Test 12 private Period period; c Tester 13 public static AtonicInteger counter = new Atomic Integer initialValue: 1); Admin Book 15 c Instructor public Lecture (AtonicInteger id, String name) { 16 this.id = id; Lecture > Period 17 this.name = name; > Person 18 > School 19 } SClass 20 C Student 21 Table 22 public Lecturel Sclass sClass, Book book, Period period) { test 23 .classpath 24 project 25 this.sClass = sClass; build.xml 26 this.book = book; manifestimmt 27 this.period = period; schoolimi 28 v lilli External Libraries 29 C Program Fileslava 30 public int getIdO { return counter.incrementAndGet(); > Inlijson-simple-1.1.1 33 BScratches and Consoles 34 public Period getPeriodo { return period; } E TODO 0 Problems 2 Terminal Eventlog 2264 CRLE UTF-8 4 spac. P master 2 9:48 AM AO 40 ENG 2/19/2021 Type here to search O 07 > idea 6 E c Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Studentjava school sc school model Student gelStudent Marks Tester cil: 5 Project I - SClassjava X Studentjava Lecture.java Schooljava x Instructor javax Lecture java x x Period.java school CADevelopment NetBear 26 super(id, name, dateOfBirth, gender); A 18 A v 1 package school. model: 27 this.students Marks = studentsMarks; 2 > .metadata 28 } 3 3 import org.json.simple.JSONObject: 29 >nbproject 30 public sclass getsClass() { return sclass; } import java.util.Date; SIC 33 import java.util.concurrent.atomic.Atomic Integer; v school 34 public void addStudentsMark(Lecture lecture, Double[] value) { Vb control 35 student Marks.put(lecture, value); public class Instructor extends Person { SchoolControl 36 9 SClass control 37 } 10 Lecture lecture; v model 38 11 VD Test 39 public List getStudent Marks() { 12 public Instructor(AtonicInteger id, String nane, Date dateOfE Tester 40 13 super(id, name, dateOfBirth, gender); Admin 41 return studentsMarks; 14 this.lecture = lecture; Book } 15 } Instructor 16 Lecture > Period public void addMark (Double mark) { studentsMarks.add(nark); } 17 public Lecture getLectures() { return Lecture; } > Person 20 > School 48 public void setStudentMarks(List C:Program Fileslava 61 } 34 public void jsonInstructor({ > Inlijson-simple-1.1.1 62 35 JSONObject object = new JSONObject(); BScratches and Consoles 63 public void setsClass (SClass sClass) { this.sClass = sClass; } 36 object.put("id", 1802); 66 37 object.put("name", "Willian"); E TODO 0 Problems 2 Terminal Frent log 4130 CRLE UTF-8 4 spac. P master 2 9:46 AM Type here to search OP 0 000 ENG 2/19/2021 School - School.java 5 Da Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help school se school model School Project $ - Class.lava X Lecture jawa x School.java school Development NetBea 1 package school.model; > idea 2 > .metadata 3 import org.json.sinple.JSONObject; Tester - #C3 Cit: Periodave package school.model; import java.time. LocalTime; A 22x1 AV 1 A 23 A public class Period { private Day day: private Time time; public Period (Day day, Time time) [ this.day day; this.time = time; } >nbproject 5 SIC 6 v school 7 vb control 8 SchoolControl 9 SClass Control 10 v model 11 VD Test 12 Tester 13 Admin Book 15 c Instructor Lecture 16 > Period 17 > Person 18 > School 19 SClass 20 C Student 21 Table 24 test 25 .classpath 28 project 29 build.xml 32 manifestimmt 33 schoolimi 36 v lilli External Libraries 37 C:\Program Fileslava 40 > Inlijson-simple-1.1.1 BScratches and Consoles import java.util.ArrayList; import java.util.HashMap; import java.util.Map: import java.util.Logging. Level; 8 9 public class School { 10 private Admin admin; 11 private ArrayList> Classes = new HashMap 13 14 public School (Admin admin, ArrayList Instructors instructors) { 15 this.admin = admin 16 this.instructors = instructors; 17 18 } 19 20 public Admin getAdmin() { return admin; } 21 22 public void setAdmin (Admin adnin) { this.admin = admin; ] 23 24 public ArrayList getInstructors() { return instructors;3 25 - 26 public void setInstructors (ArrayList> getsClasses { return 5C 29 30 public void setsClasses (Map> Classes) { thi 31 public Day getDay() { return day; } } public void setDay (Day day) { this.day = day: } public Time getTime() { return time; } public void setTime(Time time) { this.time = time; } 45 en um level 4 33 public enum Day! I TODO 0 Problems 2 Terminal Build a Fren og 201 CRLE UIF-8 4 spac. master 2 9:47 AM AO ENC 2/19/2021 Type here to search O 0 Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Table.java school sa school model) Table Tesler Cit: 5 Project - Sclass.lava X Studentjava x Table.javax Lecture.java x Personava x Admin.java x Bookia X Instructor.java x Lecture.java x Periodjava school Development NetBea 1 package school.model; 13A A 15 A > idea 2 2 package school.model: > .metadata 3 3 import org.json.simple.JSONObject; 3 4 import org.json.simple.JSONObject; >nbproject 5 import java.util.ArrayList; 5 SIC 6 import java.util.concurrent.atonic.AtomicInteger; 6 import java.util.concurrent.atomic.AtomicInteger; v school 7 7 vb control 8 public class Table { 8 public class Book SchoolControl 9 private String tableName; 9 SClass Control : private Atomic Integer id; 10 private Atomic Integer id; v model 11 private ArrayList Period 17 this.tableName = tableName; 17 > Person 18 } 18 public Book (Atomic Integer id, String name) { > School 19 19 this.name = name; SClass 20 public Table(SClass sClass, ArrayList lectures) { 20 this.id = id; C Student 21 - 21 } Table 22 this.sClass = sClass; - 22 test 23 Lectures = new ArrayList0; 23 .classpath 24 this.lectures - Lectures public Book(String authorName, int numberOfPages, int releaseYear) { project 25 } 25 build.xml 26 26 manifestimmt 27 public String getTableName() { 27 this.authorName = authorNane; schoolimi 28 return tableName; 28 this.numberOfPages = numberOfPages; v lilli External Libraries 29 } 29 this.release Year = release Year; C Program Fileslava 30 30 } > Inlijson-simple-1.1.1 31 public void setTableName(String tableNene) { this.tableName = 31 public void jsonBook OL BScratches and Consoles 32 JSONObject object = new JSONObject(); public int getIdO { return counter.incrementAndGet(); } 33 object.put("id", o). E TODO 0 Problems 2 Terminal Frending 5:28 CRLE UIF-8 4 spac. master 2 9:45 AM Type here to search 0 AOD ENG 2/19/2021 Tester CG: 5 Da Perioara // map A 23 A > idea public Time gettin() { return time } - public void setTime(Time time) { this.tine = time; } Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - School.java school sc school model School Project - Classjava x Lecture javax School.java X This instructONS = INSTRUCrors; school Development NetBear A 221 V 24 18 25 > .metadata 19 } 26 20 27 21 >nbproject public Admin getAdmin() { return adnin; } 2B 24 SIC 29 v school 25 public void setAdmin (Admin admin) { this.admin = admin; } 30 Vb control 28 31 SchoolControl 29 public ArrayList getInstructors() { return instructors; ) 32 SClassControl 32 v model 33 public void setInstructors(ArrayList instructors) { this. VD Test 35 Tester 37 public static Map> getsClasses() { return Admin 37 Ecok public void setsClasses(Map> Classes) {t 38 Instructor Lecture 39 45 enun level { > Period 46 FIRST, SECOND, THIRD, FORTH, FIFTH, SIXTH, SEVENTH, EIGHTH, NINTI > Person } > School 42 SClass public void sonschool Student Table 50 JSONDbject object = new JSONDbject(); 45 test 51 object.put("Admin", admin.getId(); - 46 .classpath 52 object.put(sClasses",getsClasses); project 53 build.xml e } 49 manifesti 55 50 schoolimi 56 } 51 v lilli External Libraries 52 C Program Files lava 53 > Inlijson-simple-1.1.1 54 Scratches and Consoles 55 public enum Day sunday, Monday, tuesday, Wednesday, Thursday: } public enum Tine { FIRST, SECOND, THIRD, FORTH, FIFTH, SIXTH, SEVENTH; c private LocalTime startTine; private final static int time = 45; private final static int breakBeforeTheclass = 5; private final static int breakLunch = 20; C public LocalTime startTheClassFirstTime(Time time) { return LocalTime.of( hour 8 minute: 0).plusMinutes (45*11 } public LocalTime endTheClassFirstTime(Tine time) { return Localtine.of( hour 8, minute: 45).plusMinutes (45** 56 TODO 0 Problems 2 Terminal Eventlog 201 CRL UIF-8 4 spac. P master 2 9:47 AM AO 20 ENC 2/19/2021 Type here to search OBE 0 Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Adminjava school sc school model Admin Tester v Git: 5 Da Project - Sclassjava X Studentjava X Table.java x Lecture.java x Personave Adminjavo X Bookjava Instructorjava x Lecture.java X Periodjava X school Development NetBea 1 package school.model; 1 package school.model; > idea 2 2 > .metadata 3 import org.json.simple.JSONObject; 3 import org.json.simple.JSONObject: 4 >nbproject 5 import java.io.IOException; 5 import java.util.Date; SIC 6 import java.io. StringWriter; 6 import java.util.concurrent.atomic.Atomic Integer; v school 7 import java.util.Date; vb control 8 import java.util.concurrent.atonic.AtomicInteger; 8 public class Admin extends Person { SchoolControl 9 9 SClass Control 10 . public class Person { 10 public Admin(AtomicInteger id, String name, Date dateOfBirth, Gender gender v model 11 11 super(id, name, dateOfBirth, gender); VD Test 12 private Atonic Integer id; 12 } c Tester 13 private String name; 13 @Override Admin private Date dateOfBirth; 14 of public String toString() { Book 15 private Cender gender; 15 return "Admin(" + c Instructor 16 private static AtomicInteger counter = new Atomic Integer( init 16 Lecture "id" = getId()+ > Period 17 - 17 name='" + getName() + '\" + > Person 18 18 ", dateOfBirth=" + getDateOfBirth() + > School 19 public enum Gender / 19 ", gender:" + getCender() + SClass 20 Male, Female 20 C Student 21 } 21 } Table 22 22 public void sonAdmin test 23 23 JSONObject object = new JSONObject(); .classpath 24 public Person (AtonicInteger id, String nane, Date dateOfBirt 2 object.put("id", 1); project 25 this.id = id; 25 object.put("name", "Jack"); build.xml 26 this.name = name; 26 object.put("dateOfBirth", 91/3/19); manifestimmt 27 this.dateOfBirth = dateOfBirth; 27 object.put("gender". Gender.Male); schoolimi 28 this.setGender(gender); 28 v lilli External Libraries 29 29 e CA Program Fileslava 30 } 30 > json-simple-1.1.1 31 31 BScratches and Consoles 32 public int getId() { 32 ) for (int i = 0; i idea Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Studentjava school sc school model Student gelStudent Marks Tester cil: 5 Project $ - sclass.lava * @ Studentjava > Lecture.java x Schooljava X Instructor javax Lecture javax Period.java school Development NetBea 1 package school.model; A 18 A v 1 package school.model; 2 > .metadata 3 import org.json.sinple.JSONObject; import org.json simple.JSONObject; 4 >nbproject 5 import java.util.*; import java.util.Date; SIC 6 import java.util.concurrent.atomic.Atomic Integer; import java.util.concurrent.atomic.Atomic Integer; v school 7 vb control 8 public class Student extends Person { 8 public class Instructor extends Person { SchoolControl 9 9 SClass Control 10 private sclass sclass: 10 Lecture lecture; v model 11 private List Double students Marks = new ArrayList studentMarks = new HashMapc0; 12 public Instructor(AtonicInteger id, String nane, Date dateOfE c Tester 13 13 super(id, name, dateOfBirth, gender); Admin public Student (AtonicInteger id, String name, Date dateOfBirth, Gender gear 14 this.lecture = lecture; Ecok 15 Instructor super(id, name, dateOfBirth, gender); 15 1 } 16 Lecture 16 this.sClass = sClass; > Period 17 e } 17 public Lecture getLectures() { return Lecture; } > Person 18 20 > School 19 public Student (AtonicInteger id, String name, Date dateOfBirth, Gender gent 21 public void setLectures(Lecture Lectures) { this. Lecture = LE SClass 20 super(id, name, dateOfBirth, gender); 24 @Override Student 21 this.studentsMarks = studentsMarks; 25 o public String toString() { 22 this.studentMarks = student Marks; 26 return "Instructor(" + test 23 } 27 "id=" + getId()+ .classpath 24 28 ", name=' + getName() + ". project 25 public Student (Atomic Integer id, String name, Date dateOfBirth, Gender gend 29 dateOfBirth=" + getDateOfBirth() + build.xml 26 super(id, name, dateOfBirth, gender); 30 *, gender=" + getGender() + manifestimmt 27 this.students Marks = studentsMarks; 31 *, SClass:" + getLectures() + schoolimi 28 } 32 v lilli External Libraries 29 33 } C Program Fileslava 30 public sclass getsClass() { return sclass; } 34 public void jsonInstructor({ > Inlijson-simple-1.1.1 33 35 JSONObject object = new JSONObject(); BScratches and Consoles public void addStudents Mark(Lecture Lecture, Double[] value) { 36 object.put("id", 1802); 35 student Marks.put(lecture, value); 37 object.put("name", "William) E TODO 0 Problems 2 Terminal Frent log 4130 CRLE UTF-8 4 spac. P master 2 9:46 AM Type here to search O 0 000 ENG 2/19/2021 C lable } Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Studentjava school sc school model) Student getStudent Marks Tester - #Cil: Gilgan Q Project - SClassjava x Studentjava X Lecture.java X School.java Instructor jawa x Lecture, java x Period.java x MODEL JELLY LIULUI EWELILCYC school Development NetBear A7 A 18 v 54 return "Student (" + 13 super(id, name, dateOfBirth, gender); > idea 55 "id=" + getId + 14 this.lecture = lecture; > .metadata 15 56 ", name='" getName()+ '\" + } 57 dateatbirth=" + getdateOfBirth() + 16 >nbproject 58 gender=" + getGender() + 17 public Lecture getLectures() { return lecture; } SIC v school 59 *, Sclass=" + getsClass(+ 20 Vb control 6D 21 public void setlectures (lecture lectures) { this.lecture = 1.6 SchoolControl 61 24 poverride SClass control 25 of public String toString() { v model public void setsClass(sclass sClass) { this.sclass = sClass; } 26 return "Instructor (" + VD Test 66 - 27 id=" + getId(). Tester 67 public List getstudentsMarks() { return students Marks; } 28 name=' + getName() + '\"' + Admin 70 29 *, dateOfBirth=" + getDateOfBirth() + Ecok 71 public void setStudents Marks(List students Marks) { this.studentsMar 30 gender=" + getGendero Instructor 31 - sclass." getLectures : Lecture 75 public void setStudentNarks(Nap studentMarks) { this.stu 32 > Period 33 } > Person public void sonstudent public void jsonInstructor of > School SD JSONDbject object = new JSONObject(). 35 JSONDbject object = new JSONObject(); SClass 81 object.put("id", 8); object.put("id", 1002); Student object.put("Name", "yahya"); 37 object.put("name", "Willian"); 83 object.put("dateOfBirth", 101 / 2 / 27); 38 object.put("dateOfBirth", 87/6/30); test object.put("Gender", Gender. Male); 39 object.put("gender", Gender Male), .classpath 85 project object.put("SClass", sClass.getId(); build.xml 86 41 manifesti 87 } 42 schoolimi SB v lilli External Libraries C:\Program Fileslava > Inlijson-simple-1.1.1 BScratches and Consoles c C lable TODO 0 Problems 2 Terminal a Frent log 41:30 CRL UIF-8 4 spac.. master 2 9:47 AM AO D 40 ENG 2/19/2021 Type here to search OBE 07 Tesler #CC 5 Da A 11 A Eile Edit View Navigate Code Analyze Befactor fuild Run Tools Git Vindow Help School - Lecturejava school c school model Lecture Lecture Project I - sclass.javax Lecture jawa x school Development NetBea 1 package school.model; > idea 2 > .metadata 3 import org.json.simple.JSONObject; 4 >nbproject 5 import java.util.concurrent.atonic.Atomic Integer; SIC 6 v school 7 public class Lecture ( vb control 8 private AtonicInteger id; SchoolControl 9 private String name; SClass Control 10 private Sclass sClass; v model 11 private Book book; VD Test 12 private Period period; c Tester 13 public static AtonicInteger counter = new Atomic Integer initialValue: 1); Admin Book 15 c Instructor public Lecture (AtonicInteger id, String name) { 16 this.id = id; Lecture > Period 17 this.name = name; > Person 18 > School 19 } SClass 20 C Student 21 Table 22 public Lecturel Sclass sClass, Book book, Period period) { test 23 .classpath 24 project 25 this.sClass = sClass; build.xml 26 this.book = book; manifestimmt 27 this.period = period; schoolimi 28 v lilli External Libraries 29 C Program Fileslava 30 public int getIdO { return counter.incrementAndGet(); > Inlijson-simple-1.1.1 33 BScratches and Consoles 34 public Period getPeriodo { return period; } E TODO 0 Problems 2 Terminal Eventlog 2264 CRLE UTF-8 4 spac. P master 2 9:48 AM AO 40 ENG 2/19/2021 Type here to search O 07 > idea 6 E c Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Studentjava school sc school model Student gelStudent Marks Tester cil: 5 Project I - SClassjava X Studentjava Lecture.java Schooljava x Instructor javax Lecture java x x Period.java school CADevelopment NetBear 26 super(id, name, dateOfBirth, gender); A 18 A v 1 package school. model: 27 this.students Marks = studentsMarks; 2 > .metadata 28 } 3 3 import org.json.simple.JSONObject: 29 >nbproject 30 public sclass getsClass() { return sclass; } import java.util.Date; SIC 33 import java.util.concurrent.atomic.Atomic Integer; v school 34 public void addStudentsMark(Lecture lecture, Double[] value) { Vb control 35 student Marks.put(lecture, value); public class Instructor extends Person { SchoolControl 36 9 SClass control 37 } 10 Lecture lecture; v model 38 11 VD Test 39 public List getStudent Marks() { 12 public Instructor(AtonicInteger id, String nane, Date dateOfE Tester 40 13 super(id, name, dateOfBirth, gender); Admin 41 return studentsMarks; 14 this.lecture = lecture; Book } 15 } Instructor 16 Lecture > Period public void addMark (Double mark) { studentsMarks.add(nark); } 17 public Lecture getLectures() { return Lecture; } > Person 20 > School 48 public void setStudentMarks(List C:Program Fileslava 61 } 34 public void jsonInstructor({ > Inlijson-simple-1.1.1 62 35 JSONObject object = new JSONObject(); BScratches and Consoles 63 public void setsClass (SClass sClass) { this.sClass = sClass; } 36 object.put("id", 1802); 66 37 object.put("name", "Willian"); E TODO 0 Problems 2 Terminal Frent log 4130 CRLE UTF-8 4 spac. P master 2 9:46 AM Type here to search OP 0 000 ENG 2/19/2021 School - School.java 5 Da Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help school se school model School Project $ - Class.lava X Lecture jawa x School.java school Development NetBea 1 package school.model; > idea 2 > .metadata 3 import org.json.sinple.JSONObject; Tester - #C3 Cit: Periodave package school.model; import java.time. LocalTime; A 22x1 AV 1 A 23 A public class Period { private Day day: private Time time; public Period (Day day, Time time) [ this.day day; this.time = time; } >nbproject 5 SIC 6 v school 7 vb control 8 SchoolControl 9 SClass Control 10 v model 11 VD Test 12 Tester 13 Admin Book 15 c Instructor Lecture 16 > Period 17 > Person 18 > School 19 SClass 20 C Student 21 Table 24 test 25 .classpath 28 project 29 build.xml 32 manifestimmt 33 schoolimi 36 v lilli External Libraries 37 C:\Program Fileslava 40 > Inlijson-simple-1.1.1 BScratches and Consoles import java.util.ArrayList; import java.util.HashMap; import java.util.Map: import java.util.Logging. Level; 8 9 public class School { 10 private Admin admin; 11 private ArrayList> Classes = new HashMap 13 14 public School (Admin admin, ArrayList Instructors instructors) { 15 this.admin = admin 16 this.instructors = instructors; 17 18 } 19 20 public Admin getAdmin() { return admin; } 21 22 public void setAdmin (Admin adnin) { this.admin = admin; ] 23 24 public ArrayList getInstructors() { return instructors;3 25 - 26 public void setInstructors (ArrayList> getsClasses { return 5C 29 30 public void setsClasses (Map> Classes) { thi 31 public Day getDay() { return day; } } public void setDay (Day day) { this.day = day: } public Time getTime() { return time; } public void setTime(Time time) { this.time = time; } 45 en um level 4 33 public enum Day! I TODO 0 Problems 2 Terminal Build a Fren og 201 CRLE UIF-8 4 spac. master 2 9:47 AM AO ENC 2/19/2021 Type here to search O 0 Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Table.java school sa school model) Table Tesler Cit: 5 Project - Sclass.lava X Studentjava x Table.javax Lecture.java x Personava x Admin.java x Bookia X Instructor.java x Lecture.java x Periodjava school Development NetBea 1 package school.model; 13A A 15 A > idea 2 2 package school.model: > .metadata 3 3 import org.json.simple.JSONObject; 3 4 import org.json.simple.JSONObject; >nbproject 5 import java.util.ArrayList; 5 SIC 6 import java.util.concurrent.atonic.AtomicInteger; 6 import java.util.concurrent.atomic.AtomicInteger; v school 7 7 vb control 8 public class Table { 8 public class Book SchoolControl 9 private String tableName; 9 SClass Control : private Atomic Integer id; 10 private Atomic Integer id; v model 11 private ArrayList Period 17 this.tableName = tableName; 17 > Person 18 } 18 public Book (Atomic Integer id, String name) { > School 19 19 this.name = name; SClass 20 public Table(SClass sClass, ArrayList lectures) { 20 this.id = id; C Student 21 - 21 } Table 22 this.sClass = sClass; - 22 test 23 Lectures = new ArrayList0; 23 .classpath 24 this.lectures - Lectures public Book(String authorName, int numberOfPages, int releaseYear) { project 25 } 25 build.xml 26 26 manifestimmt 27 public String getTableName() { 27 this.authorName = authorNane; schoolimi 28 return tableName; 28 this.numberOfPages = numberOfPages; v lilli External Libraries 29 } 29 this.release Year = release Year; C Program Fileslava 30 30 } > Inlijson-simple-1.1.1 31 public void setTableName(String tableNene) { this.tableName = 31 public void jsonBook OL BScratches and Consoles 32 JSONObject object = new JSONObject(); public int getIdO { return counter.incrementAndGet(); } 33 object.put("id", o). E TODO 0 Problems 2 Terminal Frending 5:28 CRLE UIF-8 4 spac. master 2 9:45 AM Type here to search 0 AOD ENG 2/19/2021 Tester CG: 5 Da Perioara // map A 23 A > idea public Time gettin() { return time } - public void setTime(Time time) { this.tine = time; } Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - School.java school sc school model School Project - Classjava x Lecture javax School.java X This instructONS = INSTRUCrors; school Development NetBear A 221 V 24 18 25 > .metadata 19 } 26 20 27 21 >nbproject public Admin getAdmin() { return adnin; } 2B 24 SIC 29 v school 25 public void setAdmin (Admin admin) { this.admin = admin; } 30 Vb control 28 31 SchoolControl 29 public ArrayList getInstructors() { return instructors; ) 32 SClassControl 32 v model 33 public void setInstructors(ArrayList instructors) { this. VD Test 35 Tester 37 public static Map> getsClasses() { return Admin 37 Ecok public void setsClasses(Map> Classes) {t 38 Instructor Lecture 39 45 enun level { > Period 46 FIRST, SECOND, THIRD, FORTH, FIFTH, SIXTH, SEVENTH, EIGHTH, NINTI > Person } > School 42 SClass public void sonschool Student Table 50 JSONDbject object = new JSONDbject(); 45 test 51 object.put("Admin", admin.getId(); - 46 .classpath 52 object.put(sClasses",getsClasses); project 53 build.xml e } 49 manifesti 55 50 schoolimi 56 } 51 v lilli External Libraries 52 C Program Files lava 53 > Inlijson-simple-1.1.1 54 Scratches and Consoles 55 public enum Day sunday, Monday, tuesday, Wednesday, Thursday: } public enum Tine { FIRST, SECOND, THIRD, FORTH, FIFTH, SIXTH, SEVENTH; c private LocalTime startTine; private final static int time = 45; private final static int breakBeforeTheclass = 5; private final static int breakLunch = 20; C public LocalTime startTheClassFirstTime(Time time) { return LocalTime.of( hour 8 minute: 0).plusMinutes (45*11 } public LocalTime endTheClassFirstTime(Tine time) { return Localtine.of( hour 8, minute: 45).plusMinutes (45** 56 TODO 0 Problems 2 Terminal Eventlog 201 CRL UIF-8 4 spac. P master 2 9:47 AM AO 20 ENC 2/19/2021 Type here to search OBE 0 Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Adminjava school sc school model Admin Tester v Git: 5 Da Project - Sclassjava X Studentjava X Table.java x Lecture.java x Personave Adminjavo X Bookjava Instructorjava x Lecture.java X Periodjava X school Development NetBea 1 package school.model; 1 package school.model; > idea 2 2 > .metadata 3 import org.json.simple.JSONObject; 3 import org.json.simple.JSONObject: 4 >nbproject 5 import java.io.IOException; 5 import java.util.Date; SIC 6 import java.io. StringWriter; 6 import java.util.concurrent.atomic.Atomic Integer; v school 7 import java.util.Date; vb control 8 import java.util.concurrent.atonic.AtomicInteger; 8 public class Admin extends Person { SchoolControl 9 9 SClass Control 10 . public class Person { 10 public Admin(AtomicInteger id, String name, Date dateOfBirth, Gender gender v model 11 11 super(id, name, dateOfBirth, gender); VD Test 12 private Atonic Integer id; 12 } c Tester 13 private String name; 13 @Override Admin private Date dateOfBirth; 14 of public String toString() { Book 15 private Cender gender; 15 return "Admin(" + c Instructor 16 private static AtomicInteger counter = new Atomic Integer( init 16 Lecture "id" = getId()+ > Period 17 - 17 name='" + getName() + '\" + > Person 18 18 ", dateOfBirth=" + getDateOfBirth() + > School 19 public enum Gender / 19 ", gender:" + getCender() + SClass 20 Male, Female 20 C Student 21 } 21 } Table 22 22 public void sonAdmin test 23 23 JSONObject object = new JSONObject(); .classpath 24 public Person (AtonicInteger id, String nane, Date dateOfBirt 2 object.put("id", 1); project 25 this.id = id; 25 object.put("name", "Jack"); build.xml 26 this.name = name; 26 object.put("dateOfBirth", 91/3/19); manifestimmt 27 this.dateOfBirth = dateOfBirth; 27 object.put("gender". Gender.Male); schoolimi 28 this.setGender(gender); 28 v lilli External Libraries 29 29 e CA Program Fileslava 30 } 30 > json-simple-1.1.1 31 31 BScratches and Consoles 32 public int getId() { 32 ) for (int i = 0; i idea Eile Edit View Navigate Code Analyze Befactor Build Run Tools Git Window Help School - Studentjava school sc school model Student gelStudent Marks Tester cil: 5 Project $ - sclass.lava * @ Studentjava > Lecture.java x Schooljava X Instructor javax Lecture javax Period.java school Development NetBea 1 package school.model; A 18 A v 1 package school.model; 2 > .metadata 3 import org.json.sinple.JSONObject; import org.json simple.JSONObject; 4 >nbproject 5 import java.util.*; import java.util.Date; SIC 6 import java.util.concurrent.atomic.Atomic Integer; import java.util.concurrent.atomic.Atomic Integer; v school 7 vb control 8 public class Student extends Person { 8 public class Instructor extends Person { SchoolControl 9 9 SClass Control 10 private sclass sclass: 10 Lecture lecture; v model 11 private List Double students Marks = new ArrayList studentMarks = new HashMapc0; 12 public Instructor(AtonicInteger id, String nane, Date dateOfE c Tester 13 13 super(id, name, dateOfBirth, gender); Admin public Student (AtonicInteger id, String name, Date dateOfBirth, Gender gear 14 this.lecture = lecture; Ecok 15 Instructor super(id, name, dateOfBirth, gender); 15 1 } 16 Lecture 16 this.sClass = sClass; > Period 17 e } 17 public Lecture getLectures() { return Lecture; } > Person 18 20 > School 19 public Student (AtonicInteger id, String name, Date dateOfBirth, Gender gent 21 public void setLectures(Lecture Lectures) { this. Lecture = LE SClass 20 super(id, name, dateOfBirth, gender); 24 @Override Student 21 this.studentsMarks = studentsMarks; 25 o public String toString() { 22 this.studentMarks = student Marks; 26 return "Instructor(" + test 23 } 27 "id=" + getId()+ .classpath 24 28 ", name=' + getName() + ". project 25 public Student (Atomic Integer id, String name, Date dateOfBirth, Gender gend 29 dateOfBirth=" + getDateOfBirth() + build.xml 26 super(id, name, dateOfBirth, gender); 30 *, gender=" + getGender() + manifestimmt 27 this.students Marks = studentsMarks; 31 *, SClass:" + getLectures() + schoolimi 28 } 32 v lilli External Libraries 29 33 } C Program Fileslava 30 public sclass getsClass() { return sclass; } 34 public void jsonInstructor({ > Inlijson-simple-1.1.1 33 35 JSONObject object = new JSONObject(); BScratches and Consoles public void addStudents Mark(Lecture Lecture, Double[] value) { 36 object.put("id", 1802); 35 student Marks.put(lecture, value); 37 object.put("name", "William) E TODO 0 Problems 2 Terminal Frent log 4130 CRLE UTF-8 4 spac. P master 2 9:46 AM Type here to search O 0 000 ENG 2/19/2021 C lable

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions