CS432
Preliminary Assignment
Simple Query
Deadline : Wed., September 10
Introduction
In this assignment you will implement a program that runs a simple database
query on a given table. It is intended to introduce you to several things:
-
C++ programming as we will be using it in this course.
-
The coding convention and submission procedure.
-
The general principle of database querying, and the difficulty of hard-coding
data-set queries.
Description and Specifications
You will be given a formatted text file containing data on the 1996 season
of the Chicago Bulls. Your program should input the data from this file
and return the results of a simple query on that data. The text file
for the project, called bulls.dat, is on machine 'Goose', in courses/cs432/Project
0.
(Hint: How to access machine 'Goose' ==>
)
The data has the following fields:
GAME# Date
Against W(in)/L(ost) Score
Record High SCORER/REBOUNDER/ASSISTS
EXAMPLE:
1 11/01
AT-BOS W
107-98 1-0
Jordan 30, Rodman 13, Kukoc 7
FORMAT:
# ##/##
(AT-)&&& (W/L)
###-### #-#
&&&& ##, &&&& ##, &&&&
##
The fields in a row are separated by space. #'s indicate numbers. &'s
indicate letters. The AT- in the Against field indicates an away
game.
Your program should examine each row, and select rows that fit the following
criteria: the game is an away game, and Kukoc was the leading player
in assists. As each qualifying row is found, print the entire row
to the screen.
As this project is intended to insure that everyone is practiced in
object-oriented programming, you should write several classes for this
assignment. One should represent a single row of the database, while others
should implement each field. It is not important that all classes for fields
of the data be completely fleshed out. The classes for handling the fields
for highest scorer, highest rebounder, highest in assists, and recording
the win/loss status of the game should be fully capable of handling their
information, though.
You should also use stream objects (ifstream, for example) to input
the file. Documentation on these is available in Visual C++'s online help.
Coding Convention
You need to follow certain coding convention for all your assignments.
-
Names for all classes/method/type should start with a caps. Break multiple
words with caps. For example AddFileEntry.
-
Names for all members/variables should start with small letters. Break
multiple words with caps. For example numOfPages;
-
Names for all enum/macro should be all caps. Break multiple words with
underscore. For example MINIBASE_DB.
Submission Procedure
How to hand in:
-
Create a local folder with your NetID as its name.
-
Into this folder, drop your project file, source code, and executable.
Make sure that while the executable is ready to run, it can be recompiled
as needed.
-
Insert this folder into the Project 0 Submissions network directory in
\\Goose\courses\cs432\Project 0\Submissions.
-
Set the permissions on your folder (on the network drive) so that only
the TA's (bg21 and pwm5) and yourself have 'Full Control' access
permission.
Marking Criteria
80% of the grade of this assignment is based on correctness of operation,
i.e. producing the correct results.
20% comes from coding style.
Collaboration
This assignment is individual, so no sharing of code is permitted. Discussion
of ideas is, however, permitted.
Miscellaneous
Please let us know if there is any ambiguity in the assignment and please
report any possible bugs as soon as possible. You can either mail to
Binquan Gu or Patrick
McClanahan
There are now two newsgroups for the class : cornell.class.cs432
and cornell.class.cs433, for general
discussions. Please used cornell.class.cs432
for discussion for this assignment.
Please check this page frequently for any updates or clarification.