JAVA限时作业...
CPSC 1181, Assignment 2Objectives
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. 大一学的。。。。不知道这个ArrayList是不是LZ你们学的ArrayList...ADT的话叫这名也可以有很多种implementation
直接有现成code,5分钟简单改了下。。。class和method的名字什么的自己改吧,有这个做基础剩下的都很简单了
还有,随便扫了几眼LZ你的code有些syntax的小错误。。
[ 本帖最后由 残酷的天使 于 2009-5-25 16:36 编辑 ] http://www.langara.bc.ca/science-technology/computer-science/courses.html#CPSC1181
我无聊了一下,是这个么。。 求代码不要紧,但拿到后自己要看懂哦
[ 本帖最后由 红钢怨狱 于 2009-5-25 21:10 编辑 ]
页:
[1]