Banner

Names: Michael C. Chen, Discussion 3B

            Erin Ramos, Discussion 2A

Project:            CS32, Project 3

Compiler:         Microsoft Visual C++ 5.0

 

User Documentation for Project 3

The purpose of this program is to design, implement in C++, and test a student enrollment and class scheduling program.  This program, called URSA Minor,  is to be used by students to enroll in classes while URSA Minor keeps track of these transactions.  This program is in actuality a database which can hold as many student records, courses, and rooms as the memory allows.  Time conflicts and enrollment limitations are handled by URSA Minor accordingly.  Thus, students are warned when they attempt to enroll in a class that conflicts with another one of their classes, and when other classes are full.  URSA Minor also has the capability to display course rosters for each course and a summary of a student, which includes the name, ID number, major, and study list.  However, URSA Minor does have its drawbacks.  Dropping or switching of classes is not allowed, therefore once a student enrolls in a certain class he or she is stuck with it.  Also, the classes on URSA Minor’s database are only either Monday/Wednesday courses or Tuesday/Thursday courses which begin only on even hours from 8am, the latest ending at 4pm and last for two hours.  Should a course which does not meet the preceding criteria somehow miraculously appear on the database, URSA Minor will not be able to handle it.  URSA Minor’s database is read from a text file called “ucla.txt”.  New students, courses, or rooms may not be added to the database during run-time.  In other words, if it is not on the text file, it is not in the database.

 

Required form of input data for the database consists of key fields and data fields.  A field of “9999” signifies the end of each section read. 

 

Upon entering URSA Minor, the user finds a main menu with which he has four choices.  He can either add a course to his study list, display student information, or display course information.  Once a transaction is chosen he is asked to either input his four digit student ID number (if transaction 1 or 2 is chosen) or a course title and section number (if transaction 3 is chosen).   Should transaction 1 be chosen, the user can expect to be prompted to input the class he wishes to add, and if it is valid (does not conflict and is open for enrollment) the message “Enrollment confirmed” is output to the screen to signify a valid transaction.  If it is not valid, the proper messages will be displayed.  Expected output for transaction 2 is all the student information on a particular student in the database, including a study list.  Expected output for transaction 3 is the course information for a particular course, including a roster of all the students enrolled. 

 

In order to recompile this program, all the .cpp files on the disk must be included in the project (i.e. “DataType,cpp”, “exception.cpp”, “UrsaM.cpp”, and “string.cpp”).  In order to run the .exe file, make sure that the “ucla.txt” file is in the same directory as the .exe file. 

 

 

System Documentation

 

Function to Read In from File:

while (not found "9999")
{
read data for student from a file
create student object
Student S(name, SID, major)
insert it into student tree
ST.Insert(S)
}
while (not found "9999")
{
read data for course from a file
create course object, but first create CID by concatenating name,'s', and section, so CS32 section 5 has CID="CS32s5"
Course C(CID, enrollim, time, instructor)
insert it into course tree
CT.Insert(C)
}
while (not found "9999")
{
read data for room from a file
create room object
Room R(name, capacity)
insert it into room list
RL.Insert(R)
}

Assign Room Function:

Go through list of rooms looking for adequate capacity (List class on the Web creates list sorted in ascending order, so rooms will be sorted in ascending order of capacities) up to the end of list.
{
If capacity of room you are currently positioned on is less than course's limit or the room is reserved, keep on going.
If capacity of room you are currently positioned on is greater than or equal to course's limit:
Take pointer to the room using Access(0 function and associate room with the course by:
{
Putting room (or room's name) into location for the course you are trying to assign
Mark room reserved
}
Adding a Course:

check if there exists given student in student tree, and given course in the course tree

check if enrollment limit OR room's capacity are not exceeded

add CID to student's list of courses (this requires positioning on the student in ST)

add SID to course's list of students (this requires positioning on the course in CT)

increment number of students enrolled in the course

For printing all courses student is enrolled in:

check if there exists given student in student tree, and position on it

print all courses from his list

For printing all students enrolled in the course:

check if there exists given course in course tree, and position on it

print all students from his list (this requires: taking SID from the list, going to ST, getting student's data and printing)

 

 

 

Binary Search Trees were implemented to hold the information for students and courses for the sake of efficiency.  Not only did it make it more logically and clearly organized, it was relatively quick to find a certain element.  Because a search tree was used, we needed to do an InOrder traversal.  To do this, we used an iterator class downloaded from a publisher’s website.  A bit of modifying was needed for this class in order for it to work the way we wanted it to for our program.  A linked list was used to hold the information for the rooms because we didn’t need to search the rooms by a certain criteria, only need to sequentially traverse them when assigning classes to them. 

 

 

 

Division of Labor

Algorithm:                                 Partner to partner discussion

Pseudocode:                             Michael, with help from Erin     

Header File:                              Michael                                   

User Interface:                          Both of us        

AddClass Function:                  Erin, with help from Michael

AssignRooms Function: Erin , with help from Michael

Iterator class modification:         Michael

Documentation:             Erin, with help from Michael

Text file:                                   Erin

Testing:                                     Both of us

Debugging:                               Both of us

Coding:                                    We took turns.

 

 

 

Test Data Used (ucla.txt)

 


1342

Ralph Drabble

Art History

8743

Linus VanPelt

Computer Science

5386

Jason Fox

Mathematics

2356

John Calvin

Biology

0934

Thomas Hobbes

Physics

9273

Beatle Bailey

Military Science

7543

Rex Morgan

Physiological Science

7769

Clark Kent

Journalism

1310

Ray McCreary

Undeclared

0007

James Bond

European Studies

9999

ENG3

1

TR02

3

White

ENG3

2

MW04

3

Hinomura

PS10

1

MW04

100

Freud

PS10

2

TR12

100

Jung

CS01

1

TR12

10

Kernighan

CS01

2

MW12

15

Ritchie

MS28

1

MW02

5

LaPlace

MS09

1

TR08

30

Mandelbrot

MS09

2

TR12

30

Dirac

PH15

1

MW02

10

Planck

AH02

1

MW08

25

Escher

BI45

1

TR10

5

Baltimore

9999

BH3400

30

MS5200

10

KN100

25

GEO200

2

GEO4660

5

YG7680

150

NY3440

150

UP2120

60

HG1966

5

JU9001

30

PI3141

22

9999


Home | About Me | Text Depository | Future Enhancements | Guest Book | Links

Copyright © 1998-2008 Michael Chungkun Chen
All Rights Reserved.