JAVA课程设计作业代做、代写JAVA编程设计作业、代写data留学生作业
日期:2020-06-13 11:30
JAVA Coursework (30 marks)
Suppose you need to process course information. You should design a
Course class, and Test class to handle course information.
1. Course class(20 marks)
The Course class should be able to create course, add and drop the student
name, scores, get the students and the number of students in a course, clear
all the students from a course, calculate average score and sort the average
score, and so on.
The Course class should include the following methods at least.
addStudent():
Function: add student and score
The array size should be automatically increased by creating a new larger
array and copy the contents of the current array to it when the arrays is full.
An exception will be thrown when score is negative and tip information is
displayed in caller.
dropStudent():
Function: drop student and score
The array contents should be automatically arranged when removing the
student from the course.
getAverage(): get each student average score
getSortStudent():get the sorted average score
setInformation():set the student information(name, score)
getNumberOfstudent: Return the number of students
getStudents(); Return to students
clear( ): Remove all students information from the course
toString(): override toString() to return course name, the number of
students, and created date.
compareTo(); override compareTo(), compare two course teaching hours,
return 1, 0,-1 when first one is bigger than, equal to, less than the second
one
2. Test class (10 marks)
Create 2 courses (Math, Physics), 3 students and scores for each courses as
shown below.
Math Physics
Jack 88 79
John 90 82
Mark 84 73
1. Print the all courses names, student name, and student score
2: Print each student average score
3. Sort each student average score and print them out
4. Set one student information and print updated student information
5. Drop one student and print updated student information
Assessment scheme
1: Implement and verify each method function
2: Good code structure: comments, identification, concise
Note
Java code can be named in your name(Pinyin)_ID .java format. Send me
your code before the deadline (June 16, 18.pm).