大贤者
精华
|
战斗力 鹅
|
回帖 0
注册时间 2007-12-6
|
CPSC 1181, Assignment 2
Objectives
1. Designing Classes and Objects
2. ArraysList
Requirements
Develop a program named XYCollegeTest that stores its students’ information. The program will support the following operations:
Adding new student to the XYCollege,
Looking up for an existing student,
Adding a Quiz score
Finding a student with the highest quiz average.
Deleting students from XYCollege.
Notes:
• When you quit from the program you loose all the data stored in the XYCollege
• You should create the following three classes:
o Use the Student class you created for your assignment 2. Each Student object stores the name, student number, address, and total quiz score.
You may need to modify the Student public interface.
o The XYCollege class with the list of all students (an ArrayList of Student objects).
o The XYCollegeTest class with the main method which creates a XYCollege object and manipulates (adds Student objects, deletes Student objects, etc.) the XYCollege based on user input.
• You should do appropriate error checking and display appropriate error message for wrong data entered by the user. For example:
o Check if the user enters a valid commands
o Check if the Student number entered is valid (8 digit number).
Here is a sample of what the user will see on the screen:
附件是做好的部分..
这个应该是运行的时候应该出现的样子
XYCollege directory commands:
add – Add a new Student
find– Find a Student
addQuiz – Add a quiz score for a student
findHighest – Find a students with highest quiz score
delete – Delete a Student
quit – Quit
Enter a command: add
Enter Student’s name: Abernathy, C.
Enter Student’s number: 10010123
Enter Student’s addres: 100 West 49 Ave.
A Student added to the XYCollege directory. |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|