Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The problem: -------------------------------------------------------------------

ID: 3536997 • Letter: T

Question

The problem:

-------------------------------------------------------------------------------------------------------------

Create a system that manages student record database. A student record will consist of:

- Student name

- Student ID

- Student age

- GPA


Your program should have a menu that allows the user to perform the following tasks:

- Add student record

- Display student record

- Edit student record

- Delete student record


For the purpose of this assignment, you can assume that:

- IDs are unique and that only IDs are used in searching.

- Data has to be 'permanent' (after user exits the program, data still exists)

- The database you are creating has a potential of being extremely large

- You cannot use any built in sort/search functionality (have to choose and/or write your own

algorithm)


Use the following function prototypes:
void addRecord(fstream &);
void displayRecord(fstream &);
void editRecord(fstream &);
void deleteRecord(fstream &);


-----------------------------------------------------------------------------------------------------------


Clearly state the problem (user inputs; program outputs; data validation, if any). If the problem

definition is ambiguous, state the ambiguity. Explicitly state all assumptions implicit in the assignment

(if any).


Propose a solution - describe how is the data stored, accessed etc.

Write the complete algorithm in pseudo-code. Modularize your program, at least to the level of menu

items (modularization can be finer, if needed).


Now consider the following special cases and propose alternative solutions (modifications) based on the

new requirements:

(you do not need to write complete code; just explain the modifications as precisely as possible)

1. The database is of reasonable size (i.e. would fit in RAM) and records need to be accessed fast.

Adding records to the database is about as frequent as searching for them. Accessing each

record from the hard disk is not a viable alternative.A6

2. The database is of reasonable size and records need to be accessed extremely fast. Table-lookup

(linear search) is not a viable alternative. Searching records (to display or edit) occurs much more

often than adding.

3. Unlike the record structure provided above, every single record contains a massive amount of data.

Physically moving entire records during sort is not a viable option.


Some hints:

- Obvious advantage of sorting in RAM is speed. What is the drawback?

- Binary search is extremely fast. What is the drawback?

- Think about how you can sort an array of records without moving the data. (look up index sorting

and logical vs. physical sorting)

Implement the original solution. Turn in your source code file(s), pseudo code, screenshots of program

runs as well as this document with all the questions answered.

Explanation / Answer

here is the code