首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
辅导data编程、讲解Java程序、讲解Java编程设计 讲解留学生Processing|调试Matlab程序
项目预算:
开发周期:
发布时间:
要求地区:
May 7, 2021
1. revised description of Student.courseExist()
to check whether the course is already in schedule or not. Since a student cannot select 2 courses
with the same code, name and type. If there is already a course with the same code, name and
type in the student's schedule as the parameters given, it returns true. Otherwise, it returns
false.
2. add some getter and setter methods into classes already used in test cases.
Building.setRooms
Building.getRooms
Course.setTime
Course.setType
Course.getStudents
May 6, 2021
1. revised interface name changeCourse() in CourseOperator . The method in class student
and teacher is correct before.
2. revised description of public method Student.changeCourse() implements the interface
A student could change a new course with different time or teacher but with the same course
code and type. Both with the same or different teachers are OK. Both with the same or different
classrooms are OK. If it returns true, the old course would be deleted from the student's
schedule. And the new course would be added to the schedule. The student should also be
deleted from the student list of the old course and added to the new course. If there is not an
available course for the student to choose at the time, it returns false and does not change the
schedule.
3. some typing and grammar errors in description.
May 5, 2021
1. revised error messages of Classroom.addCourse() if more than 1 error( May 5) :
boolean changeCourse( Course oldCourse1 , Course newCourse2 );
// to change oldCourse1 to newCourse2 and update the schedules.
public boolean changeCourse( Course oldCourse1 , Course newCourse2 )
Return messages are as follows:
OK: Adding course to classroom success.
ERROR: Another course already exists at the time.
ERROR: Course type not same as classroom.
ERROR: Not enough seats in the classroom for this course.
If there are more than 2 errors to add a course to a classroom at the time, it will show only 1 error
message at the order above.
2. revised description of Course.getAbbrevName()( May 5)
getAbbrevName() should get the abbreviation of the course name if it has been set. But if is
empty, it will be automatically generated by every first character in caption of each word in course
name, except some words like to, of, the, in,and. For example, getAbbrevName() of the course
"Introduction to Computer Programming A" returns "ICPA" if the AbbrevName is not set
before. It will return "JavaA" if it have been set as setAbbrevName("JavaA").
3. revised description of Teacher.getFreeClassroom()( May 5)
to the get available classrooms from the classroom list in Db.buildings. According to the teacher's
prefer location and it returns only the classrooms in the prefer location. If there is no available
classrooms in prefer location. It returns classrooms in other locations. It returns an empty list if
there isn't any available classroom for the course.
4. LocalJude.java, Db.java updates according to this document.(May 5)
Problems:
Problem 1: Design a class named Building and some basic enum structures and simple
classes
Problem 2: Design a class named Classroom
Problem 3: Design a class named Course
Problem 4: Design a class named Teacher inheriting Person implements CourseOperator
interface
Problem 5: Design a class named Student inheriting Person implements CourseOperator
interface
Notice:
1. There have been some static ArrayList of students, teachers, building and courses to
initiate some basic data in a class Db provided for you. There are also classes
CourseTime and interface CourseOperator already for you. Of course, it needs
invoke some methods you should finish. You can design more classes and more
methods in classes if you need, and submit them all together.
2. It is not necessary to consider data consistency in the class above except for those
mentioned in description below. For example, a teacher could drop a course while not
public String addCourse(Course course){}
checking whether some students have selected this course. It should be used before
students to select course.
3. There is also a junit test file for you to test the classes above you need finish. Most but
not all method would be tested in the test cases.
4. You should strictly write the class with the same names, attributes and methods with
no package in source codes.
It is a simple educational administration system for the teachers and students to arrange classes
. It should have at least the following functions:
1. The teachers can use this system to arrange their courses, such as choosing the time and the
location of the class he teaches before new semester.
2. The students can use this system to choose their courses they want to take and drop the
class they don’t like.
3. The system can print the classes schedule of a teacher, a student and a classroom.
Problem 1: Design a class named Building.
The class Building should have the following attributes.
The Class Building should have the following methods:
1. Constructor with location, id or with no argument
2. some getter and setter methods
3. public method addRoom(Classroom classroom), deleteRoom(Classroom classroom)
To add or delete a classroom to the building. Since there is a reference attribute of Building of
Classroom, it will be added or deleted successfully if they are the same building. Otherwise, it
would return false. It returns false if to delete a classroom not in the building.
4. override method toString()
private List
rooms;
private Location location;
private int id;
public Building( )
public Building( Location location , int id )
public Location getLocation() {}
public void setLocation( Location location ) {}
public int getId() {}
public void setId( int number ) {}
public List
getRooms() {}
public void setRooms( List
rooms ) {}
public boolean addRoom( Classroom room ) {}
public boolean deleteRoom( Classroom room ) {}
to get the building location name and id. For example, Building 6 of LycheePark should be
LP#6
and Building 2 of TeachingBuilding should be
TB#2
Other basic Enum types and classes.
1. Enum type of Location with values of LycheePark, TeachingBuilding
2. Enum type of CourseType with values of Lecture, Lab
3. enum type of Day with values of Monday, Tuesday, Wednesday, Thursday, Friday,
Saturday, Sunday
4. design an abstract class named Person with attributes and constructor
The schedule is used to store the courses at any CourseTime in a week. You might use some of
the codes with HashMap below. And you might get more details from books and internet.
5. A class named CourseTime with attributes, constructor and override method of equals() and
hashCode() is already provided.
String id;
String name;
Map
schedule;
schedule = new HashMap<>( );
schedule.put( course.getTime( ) , course );
schedule.remove( course.getTime( ) );
private Day day;
private int time;//1 for 8:00-9:50, 2 for 10:20-12:10, 3 for 14:00-15:50, 4 for
16:20-18:10, 5 for 19:00-20:50
public CourseTime( Day day , int time ) {
this.day = day;
this.time = time;
}
@Override
public boolean equals( Object o ) {
if ( this == o ) return true;
if ( o == null || getClass( ) != o.getClass( ) ) return false;
CourseTime that = (CourseTime) o;
return time == that.time && day == that.day;
}
@Override
public int hashCode() {
return Objects.hash( day , time );
}
Problem 2: Design a class named Classroom.
The class Classroom should have the following variables.
1. Constructor with id, seatNum, type, building, CourseType or with no argument and some
getter and setter methods.
2. override method toString()
to get the classroom type, id and seatNum, and building name and id. For example, Lecture
Room 401, Lab Room 402, Building 6 of LycheePark should be like
Classroom.type+"R"+Classroom.id+Classroom.SeatNum+Building.toString()
LectureR401(60)LP#6
LabR402(50)LP#6
3. public method addCourse() with Course
to judge whether this course could be arranged in the classroom, and add the course to the
schedule of the classroom.
It will be successful, if the classroom is empty at the course time, and the course type is the
same as the classroom's courseType, and the capacity of course is not more than the seat
numbers. Then this course will be added to the schedule of the classroom. Otherwise, the course
can not be held in the classroom, return some error messages, and do not add to the schedule.
Return messages are as follows:
OK: Adding course to classroom success.
ERROR: Another course already exists at the time.
ERROR: Course type not same as classroom.
ERROR: Not enough seats in the classroom for this course.
If there are more than 2 errors to add a course to a classroom at the time, it will show only 1 error
message at the order above.
4. public method deleteCourse() with Course
It will be true, if the course is in the schedule of the classroom and delete it from the schedule.
5. public method getCourse() by CourseTime to get the class arranged in the classrom at the
time. If there is no class at the time , return null .
int id;//eg:101
int seatNum;//eg:50
CourseType type;// Lecture or Lab
Building building;
Map
schedule;
public Classroom( int id , int seatNum , Building building, CourseType type )
public String addCourse(Course course){}
public boolean deleteCourse(Course course){}
6. public method printSchedule()
To print the schedule of a classroom as follow to the returned string:
Classroom.toString() Schedule
Monday
1 Course.code, Course.abbrevName, Teacher.name
2
3 Course.code, Course.abbrevName, Teacher.name
4 Course.code, Course.abbrevName, Teacher.name
5
Tuesday
...
Sunday
...
Notice:
If there is not a course at the time slot, it may print just the number and blank in a line in
every weekdays.
7. Public method getScheduleCourseNum()
To get the course number of the classroom schedule.
Problem 3: Design a class named Course.
The class Course should have the following variables.
Notice:
You may use a static idCnt to count the number of courses created, and set it as id.
The class CourseType and CourseTime are all the enumeration class.
The Class Course should have the following methods:
public Course getCourse(CourseTime courseTime){}
public String printSchedule()
public int getScheduleCourseNum()
static int idCnt = 0;// number of courses created
int id;//generated automatically from 1
String name; // Introduction to Computer Programming A
String abbrevName;// JavaA
String code; // CS102A
CourseTime time;
Teacher teacher;
Classroom room;
List
students;// who selected this course
int capacity;// maxium number of students
CourseType type;//Lecture, Lab
1. some constructors of Course
The student list should be initialized when a course constructed.
Notice:
If the course constructor is with classroom and time, it would just set the attributes of the
course, but not be added to the classroom's schedule in the constructor automatically. It
would be added after checking the classroom's schedule by Classroom.addCourse().
2. some getter and setter methods
Notice:
getAbbrevName() should get the abbreviation of the course name if it has been set. But if
is empty, it will be automatically generated by every first character in caption of each word
in course name, except some words like to, of, the, in,and. For example,
getAbbrevName() of the course "Introduction to Computer Programming A" returns
"ICPA" if the AbbrevName is not set before. It will return "JavaA" if it have been set as
setAbbrevName("JavaA").
3. public method setRoomTime()
public Course( String code , String name , String abbrevName , Teacher
teacher , int capacity , CourseType type )
public Course( String code , String name , String abbrevName , Teacher
teacher , int capacity , CourseType type, CourseTime time , Classroom room)
public String getAbbrevName() { }
public void setAbbrevName(String abbrevName) { }
public void setAbbrevName() { }
public CourseTime getTime() { }
public void setTime(CourseTime time) { }
public Teacher getTeacher() { }
public void setTeacher(Teacher teacher) { }
public Classroom getRoom() { }
public void setRoomTime(Classroom room, CourseTime time) { }
public int getCapacity() { }
public void setCapacity(int capacity) { }
public void setType(CourseType type) { }
public CourseType getType() { }
public List
getStudents() { }
To set the time and classroom for the course. If the course is created by constructor without
classroom and time, this method is needed.
4. public method addStudent()
To add a student to the list of those students who choose the course. If the student is already in
the list, it returns false to add into the list. Otherwise, the student would be added to the list and it
returns true.
5. public method deleteStudent()
To delete a student from the list of those students who choose the course. If the student is
already in the list, it returns true to delete from the list. Otherwise, it returns false.
Problem 4: Design a class named Teacher inheriting Person
implements CourseOperator interface
The class Teacher should have a new attribute and getter, setter methods.
It shows that the teacher would like the course to be in the preferred location than other
locations. For example, If there are both some classroom available in two locations, the teacher
will choose the classroom in the preferred location. The teacher will choose the classroom in
other locations only if there is not any available classroom in the preferred location.
1. Constructor with id, name or with no argument
2. public method getFreeClassroom by CourseTime, capacity, type
to the get available classrooms from the classroom list in Db.buildings. According to the teacher's
prefer location and it returns only the classrooms in the prefer location. If there is no available
classrooms in prefer location. It returns classrooms in other locations. It returns an empty list if
there isn't any available classroom for the course.
3. public method createCourse()
public void setRoomTime( Classroom room, CourseTime time )
public boolean addStudent (Student student){}
public boolean deleteStudent (Student student){}
private Location preferLocation;
public Location getPreferLocation() {}
public void setPreferLocation( Location preferLocation )
public Teacher(){}
public Teacher( String id , String name ) {}
public List
getFreeClassroom(CourseTime time, int capacity,
CourseType type )
to create a course and add it to the teacher's schedule.
It should be checked whether the course in already on the teacher's schedule. It cannot create the
course and return false if the course already exists on the teacher's schedule.
A course with course time and classroom could be created successfully only the classroom is
empty at the course time, and the course type is the same as the classroom's courseType, and the
capacity of course is not more than the seat numbers. Then this course will be added to the
teacher's schedule and to the classroom's schedule. Otherwise the course can not be in the
classroom, return false and do not add the the schedule.
4. public method dropCourse() implements the interface
If the course is not already on the schedule of the teacher, return false.
Else remove the selected course in teacher’s schedule and classroom’s schedule, return true.
Notice:
The teacher can only drop or change a course before students select courses. So it is not
necessary to check students' schedules in this method.
5. public method changeCourse() implements the interface
A teacher could change his course time and classroom. There must be the same course code and
type and teacher. If the classroom is available at the new time and the teacher is free, it returns
true. Otherwise it returns false. If it returns true, the old course would be deleted from the
teacher's schedule and classroom's schedule, and the new one would be added in.
6. public method printSchedule()
To print the schedule of a teacher as follow to returned string:
Teacher.name's Schedule
Monday
1 Course.code, Course.abbrevName, Classroom.toSting()
2
3 Course.code, Course.abbrevName, Classroom.toSting()
4 Course.code, Course.abbrevName, Classroom.toSting()
5
Tuesday
...
Sunday
...
boolean createCourse(Course course ) {}
boolean createCourse(String code , String name , String abbrevName, CourseTime
time , Classroom room , int capacity , CourseType type ) {}
public boolean dropCourse( Course course )
public boolean changeCourse( Course oldCourse1 , Course newCourse2 )
public String printSchedule()
Notice:
If there is not a course at the time slot, it may print just the number and blank in a line in
every weekdays.
7. Public method getScheduleCourseNum()
To get the course number of the schedule.
Problem 5: Design a class named Student inheriting Person
implements CourseOperator interface
1. Constructor with id, name or with no argument
2. public method courseExist()
to check whether the course is already in schedule or not. Since a student cannot select 2 courses
with the same code, name and type. If there is a course with the same code, name and type in the
student's schedule as the parameters given, it returns true. Otherwise, it returns false.
3. public method chooseCourse()
A student can choose a course from the course list if
1. hasn't had this course before. One can not choose 2 courses with same name, code
and type, but different teachers. One can choose 2 courses with same name and code,
but different types, eg JavaA lecture and lab, no matter by a same teacher or different
teachers.
Notice: For example, students can choose 1 javaA lecture and 1 lab course from any
teacher. It is not considered whether students of a lab class are from the same lecture,
which is different from the actual situation in SUSTech.
2. and doesn't have class during the course time
3. and the course capacity is not full.
If a student choose the course successfully, the course will be added to the student's schedule
and to add the student to the student list of the course, then it returns true. Otherwise, it return
false.
4. public method dropCourse() implements the interface
If the course is not on the schedule of the student, return false.
Else remove the selected course in student’s schedule and remove the student from the student
list of the course, return true.
public int getScheduleCourseNum()
public Student(){}
public Student( String id , String name ) {}
public boolean courseExist( String code , String name , CourseType type )
public boolean courseExist( Course course )
boolean chooseCourse( Course course){}
5. public method changeCourse() implements the interface
A student could change a new course with different time or teacher but with the same course
code and type. Both with the same or different teachers are OK. Both with the same or different
classrooms are OK. If it returns true, the old course would be deleted from the student's
schedule. And the new course would be added to the schedule. The student should also be
deleted from the student list from the old course and added to the new course. If there is not an
available course for the student to choose at the time, it returns false and does not change the
schedule.
6. public method printSchedule()
To print the schedule of a student as follow to the returned string:
Student.name()'s Schedule
Monday
1 Course.code, Course.abbrevName, Teacher.name, Classroom.toSting()
2
3 Course.code, Course.abbrevName, Teacher.name, Classroom.toSting()
4 Course.code, Course.abbrevName, Teacher.name, Classroom.toSting()
5
Tuesday
...
Sunday
...
Notice:
If there is not a course at the time slot, it may print just the number and blank in a line in
every weekdays.
7. Public method getScheduleCourseNum()
To get the course number of the schedule.
CourseOperator interface
public boolean dropCourse( Course course )
public boolean changeCourse( Course oldCourse1 , Course newCourse2 )
public String printSchedule()
public int getScheduleCourseNum()
public interface CourseOperator {
// some common operators of coursees for both teachers and students.
// which may be implemented differently for teachers and students
boolean dropCourse( Course course );
// to drop the course and delete it from schedule.
// There is not necessary to check whether some students have had the ccourse
for teachers in this method.
boolean changeCourse( Course oldCourse1 , Course newCourse2 );
// to change oldCourse1 to newCourse2 and update the schedules.
// A student could change a new course with different time or teacher but
with the same course code and type. Both with the same or different teachers are
OK. Both with the same or different classrooms are OK. If it returns true, the
old course would be deleted from the student's schedule. And the new course would
be added to the schedule. If there is not an available course for the student to
choose at the time, it returns false and dose not change the schedule.
// A teacher could change his course time and classroom. There must be the
same course code and type and teacher. If the classroom is available at the new
time and the teacher is free, it returns true. Otherwise it returns false. If it
returns true, the old course would be deleted from the teacher's schedule and
classroom's schedule, and the new one would be added in.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!