代写CourseManager编程、代做java程序语言
CourseManager
Description
In this assignment, you are tasked with implementing a class named CourseManager . This
system works in conjunction with predefined Student and Course classes to implement a
Credit-based Course Selection System. This system needs to include functionalities for
students to select courses based on credit points or cancel the selection, as well as generate
results for credit-based course selections.
In the credit-based course selection system, there exist two states:
when ifOpen is set to true , it means that the credit-based course selection phase is currently
underway;
else, when ifOpen is false , it denotes that the course selection period has ended, In this state,
the system determines the final list of successful enrollments based on the course capacity and
the credit bids placed.
For Student:
Within the course selection system, each student has an initial credit value credits , a list of
enrolled courses enrollCourses , and a list of successfully selected courses successCourses .
During the credit-based course selection phase, a student can:
1. Bid credits to enroll courses. A student can not enroll one course twice.
2. Modify the credit values allocated to a enrolled course.
3. Cancel course enrollment, with the bid credits being refunded.
4. Update enrollCourse (upon course selection or cancel).
5. Query their list of courses they have bid credits for and the corresponding credits.
After the credit-based course selection phase ends, a student can:
1. Update successCourse (upon course withdraw).
2. View their list of successfully enrolled courses.
3. Withdraw course selection, but note that credit refunds are not provided.
For Course:
Each course has a set capacity, along with a list of students who have bid credits enrollStudent
and their corresponding credit lists credits , as well as a list of students who have successfully
enrolled in the course successStudents .
During the credit-based course selection phase, a course can:
1. Obtain the list of credit points bid by students credits .
2. Get a list of students who have bid credits enrollStudents .
3. Update enrollStudent and credits (when course enrollments, withdrawals, or
changes to credit bids occur).
After the credit-based course selection phase ends, a course can:
1. Update successStudents .
2. Query the list of students who have successfully enrolled.
For the CourseManager:
The course selection system maintains a status ifOpen and holds a list of all students students
and a list of all courses courses .
During the credit-based course selection phase, the course selection system can:
1. Update student and course information based on course selection applications.
2. Update student and course information based on course withdrawal applications.
3. Return to a student their list of courses for which they have bid credits and the
corresponding credits upon querying their course status.
At the end of the credit-based course selection phase, the course selection system can:
1. Generate the enrollment results for each course based on the students' credit bids and
the course capacities, subsequently updating relevant student and course information
accordingly.
Problems
Student and Course classes are in CourseManagerTest.java
CourseManagerTest.java can be download from blackboard or by:
link:https://pan.baidu.com/s/1BRGjdYnvNtxGrZzXYTWyQQ?pwd=1111
1. Review and understand the provided Student class. [No Points]
2. Review and understand the provided Course class. [No Points]
3. Implement and submit the CourseManager class. [100 Points]
submission guideline can be download from blackboard or by:
link:https://pan.baidu.com/s/1pBRUC0_SCvkp2_mttFhV9w?pwd=1111
Notes for this assignment
1. Do not use package statements in your source code.
2. The output of methods should follow the specification exactly. Do not print extraneous
information within any methods.
3. The CourseManager class must interface correctly with the provided Student and Course
classes without modifying them.
We will explain the classes mentioned in this assignment, in which the Student and Course
classes will explain the fields involved, please refer to the specific methods in codes provided
on your own, and the CourseManager class will explain the fields as well as the use of the
methods that need to be implemented and the points of note
Class1: Student (already implemented, not to be submitted)
Review the provided Student.java file. The Student class represents a student with specific
attributes and behaviors. Use this information to determine how the CourseManager should
interact with students.
Fields:
Class2: Course (already implemented, not to be submitted)
Review the provided Course.java file. The Course class represents a course with attributes
such as capacity, students enrolled, and enrollment credits. Utilize this information when
implementing the CourseManager .
Fields:
// Basic information about one student and the studentID is unique.
// Same student ID or same student objects can both be considered as
representing the same student.
private String studentID;
private String email;
private String name;
// The manager class instance, in which all the methods related to the
interaction between the student and the course are implemented.
// Each student only enrolls in one cousermanager.
private CourseManager courseManager;
// Credit points available for students, will be assigned in the constructor or
set method.
private int credits;
// Record of courses for which credits have been bid.
private ArrayList<Course> enrollCourses;
// Successfully selected courses after the end of the credit-based course
selection phase.
private ArrayList<Course> successCourses;
// Basic information about one course and the curseID is unique.
// Same course ID or same course objects can both be considered as representing
the same course.
private String courseID;
private String courseName;
// Maxmium capacity for this course
private int maxCapacity;
// The manager class instance, in which all the methods related to the
interaction between the student and the course are implemented.
// Each course only enrolls in one cousermanager.
private CourseManager courseManager;
// Students who bid credits for the course and the corresponding credits bid
private ArrayList<Student> enrollStudent;
private ArrayList<Integer> credits;
Class3: CourseManager (need implemented)
Implement a class named CourseManager in CourseManager.java . This class is responsible for
managing all course-related and student-related functionality in the system. In the class
CourseManager you need to define:
Fields:
Constructor:
Methods:
// Successfully selected students for this course after the end of the creditbased course selection phase.
private ArrayList<Student> successStudents;
private ArrayList<Course> courses
// Maintains a record of all courses successfully registered.
// It is guaranteed that students enrolled in a course must exist in students.
private ArrayList<Student> students
// Maintains a record of all students successfully registered.
// It is guaranteed that courses student enrolled in must exist in courses.
private boolean ifOpen
// Represent system open(true) or not(false).
public CourseManager()
// Constructor, initializes the course and student lists, and set the system
default status open(true).
public ArrayList<Student> getStudents()
// getter for students
public ArrayList<Course> getCourses()
// getter for courses
public void setIfOpen(Boolean ifOpen)
// setter for ifOpen
public boolean getIfOpen()
// getter for ifOpen
public void addCourse(Course course)
// Register a course. Add a course object to courses and set the courseManager
of the course object to this manager. It is guaranteed that all courseIDs are
unique.
public void addStudent(Student student)
// Register a course. Add a student object to students and set the courseManager
of the student object to this manager. It is guaranteed that all studentIDs are
unique.
/**
* Attempts to enroll a Student in a Course.
* Enrollment will only be successful if the course exists, the student has not
already enrolled, the credits is greater than 0, and they have enough credits to
bid.
* If successful, the student's credits will be reduced by the amount bid on the
course. The corresponding list in Student and Course should be updated.
* Only available when ifOpen is true. Return false if ifOpen is false.
* @return boolean Returns true if student enroll this course successfully;
otherwise, it returns false.
*/
public boolean enrollStudentInCourse(Student student, String courseId, int
credits)
/**
* Modifies the number of credits a student has bid on an already enrolled
course.
* The modification will only be successful if the course exists, the student is
currently enrolled in the course,and the new bid is within the student's
available credits. This can be used to increase or decrease the bid.
* On a successful bid modification, the student's credits will be updated to
reflect the new bid amount. The corresponding list in Student and Course should
be updated.
* Only available when ifOpen is true. Return false if ifOpen is false.
* @return boolean Returns true if the bid modification was successful;
otherwise, it returns false.
*/
public boolean modifyStudentEnrollmentCredits(Student student, String courseId,
int credits)
/**
* Drops a student's enrollment from a specific course.
* The drop will succeed only if the course exists, and the student is currently
enrolled in it.
* If ifOpen is true, upon a successful drop, any credits the student had bid
for this course will be refunded in full. The corresponding list in Student and
Course should be updated.
* Only available when ifOpen is true. Return false if ifOpen is false.
* @return boolean Returns true if the student successfully drops the course;
otherwise, it returns false.
*/
public boolean dropStudentEnrollmentCourse(Student student, String courseId)
It should be noted that, as in the case of our normal selection, if the number of electors exceeds
the maximum number of courses, the principle of "same credit, same drop" will be followed.
Eg. If the maximum number of students is 10, and 15 students choose this course, and after
sorted by enrolled points, if the 8th, 9th, 10th, and 11th students are all of the same credit, then
the four of them will not be able to choose the course successfully, and the number of successful
students will be seven.
(Add any necessary additional methods or helper functions you deem necessary)
Submission Instructions:
Submit CourseManager.java only.
Student and Course classes are in CourseManagerTest.java
Ensure your code can pass CourseManagerTest.java .
How to test your code:
1. Put CourseManagerTest.java to the same directory as CourseManager.java
2. Open CourseManager.java
3. Click red junit①, then click red bulb②. Choose Add 'JUnit5.8.1' to classpath③.
/**
* Completes the course registration process. Change ifOpen to false.
* This method resolves which students get into each course based on their bids
and the course capacities. Students with higher bids are prioritized. The
corresponding list in Student and Course should be updated.
* Only successStudents in class Course and successCourses in class Student need
to be updated.
*/
public void finalizeEnrollments()
/**
* Retrieves a list of courses with associated credits for a given student.
* Each String in the list includes the course ID and the points bid by the
student in enrollCourses, follow the format: "courseID: enrollmentCredits"
(without quotes).
* Only available when ifOpen is true. Return null if ifOpen is false.
* @return A list of Strings, each representing the courses and the respective
credits the student enrolled.
*/
public ArrayList<String> getEnrolledCoursesWithCredits(Student student)
4. Click OK.
5. Click green arrow before "class CourseManagerTest{". And choose Run.
6. You got the running result. Click each test case to see the detail.
How to test your code:
1. Click New File.
2. Choose the new file① and click Rename②.
3. Input the filename①(must end with .java), and click Confirm Rename②.
4. Click Code Submission to submit your code.
请加QQ:99515681 邮箱:99515681@qq.com WX:codinghelp
- 专业海外行销者分享 如何使用WhatsApp群发精准规避风控
- telegram营销软件,telegram群发软件,专注跨境爆粉神器联系天宇
- Ins高效筛选助手,Instagram群发代发工具,让你的营销更简单!
- CS 2550代做、代写SQL设计编程
- Instagram营销软件 - ins自动登录/ig采集指定地区/ins群发软件
- 登上国际顶刊的鼻喷,一位英国医学科学院院士的科研成果转化之旅
- 限时领取免费门票丨5月邀您共聚2024 TCT亚洲展,汇集前端科技聚势拓新!
- 再度携手山姆,星期零海苔豆腐上新
- Instagram营销群发工具,ins私信采集软件/ig博主采集神器/测试联系大轩
- 海纳AI面试官发布智能校招一体化解决方案
- Ins群发营销软件,Instagram打粉工具,让你的营销无往不利!
- Ins群发群控工具,Instagram多开云控群发,助你快速推广!
- Telegram/TG群发拉群自动化软件,电报/TG精准营销软件,TG/纸飞机全自动注册
- 求臻医学MRD产品斩获2023年度肿瘤标志物年度十大创新技术产品奖
- 个人轻松,企业高效! 跨境电商LINE代拉群群发软件,您营销成功的得力助手
- 倍冲刺 WhatsApp拉群工具 引领你的销售数字勇攀高峰
- 代写program编程、代做C/C++,Java程序
- 代做COMP9334、Python/Java程序设计代写
- instagram新手营销推广必备工具,ins独家自动群发软件
- TPS2384APAP: Exploring the Versatile Power Sourcing Equipment Controller | ChipsX
- Ins自动登录,Ig采集指定地区,instagram全球定位采集工具
- Instagram群发助手 - ins定位采集/ig私信博主/ins批量养号/ig吸客
- 外贸探险家:WhatsApp拉群工具,我这个小白的外贸探险之旅
- Line协议号注册器,全球协议管理的领先者,助您实现海外市场的巅峰
- COMP3411代做、python语言程序代写
- EE5311代写、代做Java/Python程序设计
- 新疆维吾尔自治区卫健委领导莅临神州医疗大兴产品研发及产业化基地调研指导
- EG25H4代做、代写Python/c++程序
- Telegram营销软件群发引流神器,解决你的引流烦恼
- Ins爆粉机器人,Instagram引流营销软件全球震撼推荐!
推荐
- 创意驱动增长,Adobe护城河够深吗? Adobe通过其Creative Cloud订阅捆绑包具有 科技
- 升级的脉脉,正在以招聘业务铺开商业化版图 长久以来,求职信息流不对称、单向的信息传递 科技
- 如何经营一家好企业,需要具备什么要素特点 我们大多数人刚开始创办一家企业都遇到经营 科技
- 智慧驱动 共创未来| 东芝硬盘创新数据存储技术 为期三天的第五届中国(昆明)南亚社会公共安 科技
- B站更新决策机构名单:共有 29 名掌权管理者,包括陈睿、徐逸、李旎、樊欣等人 1 月 15 日消息,据界面新闻,B站上周发布内部 科技
- 老杨第一次再度抓握住一瓶水,他由此产生了新的憧憬 瘫痪十四年后,老杨第一次再度抓握住一瓶水,他 科技
- 苹果罕见大降价,华为的压力给到了? 1、苹果官网罕见大降价冲上热搜。原因是苹 科技
- 疫情期间 这个品牌实现了疯狂扩张 记得第一次喝瑞幸,还是2017年底去北京出差的 科技
- 全力打造中国“创业之都”名片,第十届中国创业者大会将在郑州召开 北京创业科创科技中心主办的第十届中国创业 科技
- 丰田章男称未来依然需要内燃机 已经启动电动机新项目 尽管电动车在全球范围内持续崛起,但丰田章男 科技