Sei sulla pagina 1di 4

C Sc 335 Project #7 Course Registration System

Pair Programming, due Thursday October 30th @ 10:00 p.m.

This project is to be completed in a pair-programming mode. This means you and your partner will
develop all code at the same computer at the same time. When you are typing, your partner is offering
advice, helping you debug, offering suggestions, and reminding you to write unit tests. Each partner
should spend as much time at the keyboard. Switch at least once every half hour (could switch within
minutes or even seconds). Be kind to each other. Read All I Really Need to Know about Pair
Programming I Learned in Kindergarden.
This project is presented in the format of an informal methodology. In addition to the system
specification and details, this document contains a suggested ordering of activities, all of which should be
done with your pair programming partner. You are asked to complete a system that already has a good
portion of the model completed.

The System
As the head of the information systems for MooseFalls College, you are tasked with developing a new
student registration system. The new system will allow students to register for courses. You will use the
existing course catalogue to create a list of course offerings for the semester. Information about each
course offering will be accessible to students to help make informed decisions. This information includes,
course number, room location, seat availability, and day and time of the course. Each course offering is
aware of the maximum capacity and the current number of students registered. Your system must now
allow students to add any course as long as the following are true:

o Adding the course will not exceed 19 credits


o Student does not already have the course scheduled
o The course is not full (there will be no waiting lists)
o There is no time/day conflict.

Preview of User Interface

The following screenshot provides a preview of the user interface. This is not a final user interface and
you do not have to match it exactly.
Suggested Ordering of Activities
1. Find a partner.
If you know someone you can work with, relocate there now. You will need to program with this other
person today approximately 12 hours over the next 9 days.

2. Find the Objects Keep this to turnin for partial credit

Write a list of candidate objects.

3. Sketch a class diagram Keep this to turnin for credit

Draw an informal class diagram. On a piece of paper, draw a class diagram that includes each candidate
object. Each class should contain at least the class name. Add any method names or attributes (name and
type) that you can think of quickly. Draw any associations to indicate a relationship. These could simply
be lines. Write any multiplicity adornment you can think of. You will likely have 1, and * in several
places. Relax this is a first sketch. You do not need to hand this in.

4. Download he project

Go to the lab and then load up the 335 Announcements page, Download the project into either you or
your partner's workspace. The project is set up to run tests and includes the following classes and unit
tests: Student, StudentList, Course, and CourseList. Here are four example course offerings that are given
in a larger collection (see the default constructor for CourseCatalog).

Course Credit Title Max Reg Days Time Room


ANTH 101 3 Intro to Anthropology 2 0 MWF 9:00 AE 1501
ART 102 4 One-Dimensional Design 2 1 MWF 9:00 MS 341
ART 202 4 Two-Dimensional Design 2 1 TTh 12:00 KE 556
AUD 114 3 Audiology 2 2 TTh 12:00 GHC 3201

You are also given a StudentList that stores the minimal students. The collection has these four Student
objects with the given IDs and passwords.

2
Name Id Password
Ali 1111 pw1
Beth 2222 pw2
Kim 3333 pw2
Devon 4444 pw4

5. Build the rest of the system

The following represent a set of stories and tasks that you must complete. They are listed to help organize
your activities. You do not need to follow them exactly. A story represents a portion of the system needed
to make progress to getting the project completed. The tasks (indented with numbers below) are more
specific jobs needed to get the story working.

o Build a portion of the GUI to search for courses based on course numbers
1. Be able to highlight any course beginning with text in a text field. The highlighted
offering should change in response to each keystroke. New things include JList and
JScrollPane
2. Show selected course no matter where it is (new thing: ensureIndexIsVisible)
3. If necessary, make font MonoSpace and change any toString to line up output. New
things: Font and setFont.

o Students can add and drop courses (Use test-first design so students can add and drop courses from a
student course schedule). This becomes part of the model.
1. Show the current student's schedule (which may be empty)
2. Add a course as long as the student will not exceed 19 credits, does not already have the
course scheduled, the course is not full, and there is no time/day conflict.
3. Drop a course offering if it is on the student's schedule.

o Allow users to add and drop courses in a GUI. Use a default student when the GUI begins. He/She
may have 2 or 3 courses added. This is for testing only. Later you will allow any student to add/drop.
1. Add a selected course offering
2. Drop a course from the current schedule (see the list change)
3. Notify the student why a course was not added
4. Show any changes to the course offering list and the student schedule as soon as it
happens. You may need to repaint the JList object. New thing: the JList repaint
method.

o If you haven't already done so, allow students to login or inform the student of these errors:
o Tell students if the student number was not found
o Tell students if the password is invalid
o Do not allow schedule changes unless a student is logged in

Turning in the Project

Details will be provided later. You may have different section leaders.

Notes on working with this project:


• No need to check for course prereqs (this would be cool, but will postpone this feature)
• Learn About JList
• Learn about DefaultListModel, it's similar to Vector, a collection class but it notifies the view (a
JList) that is listening to the model. Maintains Model View Separation.
• Learn about JScrollPane, (need to know JList first)
• From JList, you will need to look up ensureIndexIsVisible, setSelectedIndex, and
getSelectedIndex.
3
• For each new method, or class such as schedule) in your model, add a test to your unit test, especially
if there is selection or repetition.
• Comments are required in the following places.
o Every class (test classes excluded) should have a comment at the top to describe the main
responsibility of the class. This could be one or two sentences long.
o Comment code and/or methods that would be otherwise unclear.
o Additionally place your name and your pair programming partners name at the top of the
file that starts your system: RunScheduleFrame and the schedule frame that is constructed
in RunScheduleFrame. You can add your names to any other file.
• You are free to design and code as you wish. Rick recommends that you keep any list shown in the
GUI be a DefaultListModel object. Any change to the list tells the view to update the view in the
GUI (but a change to a course offering in as list will not; use repaint.
• Careful! This compiles when result is an int and getCredits returns a double
result += courseToAdd.getCredits();

while this found the expected compiletime error (this could avoid a difficult to detect bug)
result = result + courseToAdd.getCredits();

Potrebbero piacerti anche