[Design and Programming Assignment
#2]
Title:
Development of a set of API¡¯s for a toy storage system.
Goal:
To develop a set of API¡¯s, which are used for a small storage system.
Record:
Student
- year: 1 byte integer
- ID: 9
characters
- name: 30 characters
- dept: 20 characters
- score: 4 byte floating point number
Functional
Specification:
1) Storing records of fixed length,
2) Operators using index and hash,
3) Simple query processing, and
4) Loading and writing records from disks
* Note that you must implement the functions explained and
the main program will be offered by TA.
Development
Environment
- NTFS or FAT32
- MS-Windows
- VC++ 6.0
Interfaces
1. open related files and initialize DB.
error_code openDB(char* DBName)
a) DBName is the name of DB, e.g. my_students.
b) You
define an enumeration type error_code.
If the function is correctly executed, then the error code is 0.
2. close related files and finalize DB.
error_code closeDB(char* DBName)
a) DBName is the name of DB, e.g. my_students.
b) You
define an enumeration type error_code.
3. Search records with a given condition
error_code searchRecords(char*
condition, int* numberStudents, char* resultFile)
a) numberStudents is the number of records as the answer.
b) The
condition is given as a character string, such as
¡°lower_bound<=attribute_name<=upper_bound¡± and
specifies only one condition. When lower_bound=upper_bound,
this condition implies an exact match query.
The attributes name and dept allow only exact match queries.
c) The
records retrieved by this function must be stored in resultFile in ASCII under the following format;
one line for each student record like
name(30 characters)+¡± ¡°+ID(9 characters)+ ¡± ¡°+year(1 character)+ ¡±
¡°+dept(20 character)+ ¡± ¡°+score(1 digt+¡±.¡±+ 2 digits)
For example
Ki-Joune Li
A19802345 1 Computer Science 2.76
Hwan-Gue Cho
A19802346 1 Computer Science 3.56
. . .
4. Insert a record
error_code insertRecord(char year,
char* ID, char* name, char* dept, float score)
5. Delete records with a
given condition
error_code deleteRecords(int* numberStudents,
char* condition)
a) numberStudents is the number of records deleted.
b) The condition
is given as search query
Evaluation
based on
- Submitted documents
- Oral test with demonstration for
a workload prepared by TA.
The workload
will be implemented by the main program according to
an execution
scenario.
- Ranks will be given according to
the execution time for the given scenario,
and bonus of 20%, 15%,
10%, and 10% will be given to the four fastest ones.
Note that these bonus
rates are over the total sum of tests and assignments.
Due
date
1) 1st Round (Oral Test) – June 4,
2) 2nd Round (Execution Time Check) – June 5,
3) Final Round – June 9
Only the programs that will pass the 1st round can go to the 2nd
round.
And the top five programs go to the final round.
Note
1) Main program with certain scenario will be posted at the lecture web page.
Use
this Source for test
1) This source code is not complete
2) Follow format of source code
3) Cheer up~! No apply No score
Winners
of the contest
1st 200524195
2nd 200424216
3rd 200324199