CS5600: Programming Assignment 1 (50 points) In this assignment, you will learn how to implement the index file structure. You can use the CSV file (Employee.dat) that provided in this assignment as a

CS5600: Programming Assignment 1 (50 points)

In this assignment, you will learn how to implement the index file structure.

You can use the CSV file (Employee.dat) that provided in this assignment as a master file.

This is a header of master file:

Emp ID

First Name

Last Name

Gender

Date of Birth

Weight in Kgs.

Salary

SSN

City

State

EmpID : Employee ID (No Duplicate)

First Name: (No Duplicate)

Last Name:

Gender: M/F

Date of Birth: MM/DD/YY

Weight in Kilograms:

Salary:

SSN (Social Security Number): 999-99-9999 (No Duplicate)

City:

State:

You must create the index file (Index.dat) by chose the attribute that is no redundancy, such as EmpID, First Name or SSN.

Submission:

Turn in your codes, master and index files in folder name “PROG_ASSIGN1_XXXXX_YYYYYY” where XXXXX is course number (CRN) and YYYYYY is 700# student id, and zip the folder before submitting your assignment.

This is an example of master file consist of Name, Position, Department.

Rec#

Name

Position

Department

Khomsun

Salesman

Sales

Tim

Clerk

HR

James

Officer

Stock

Adam

Manager

HR

White

Supervisor

Sales

Josh

Salesman

Sales

Ryan

Officer

Stock

Bobby

Clerk

HR

You can create the index file by using name as index key. The structure of index file contains

Index key

Pointer

The index file must sort by index key as follows:

Index key

Pointer (Rec#)

Adam

Bobby

James

Josh

Khomsun

Ryan

Tim

White

Your program must let users insert the new records or tuples. After insertion, you should update the master and index files.

Example: Enter new record: Fred, Salesman, Sales

Master file

Rec#

Name

Position

Department

Khomsun

Salesman

Sales

Tim

Clerk

HR

James

Officer

Stock

Adam

Manager

HR

White

Supervisor

Sales

Josh

Salesman

Sales

Ryan

Officer

Stock

Bobby

Clerk

HR

Fred

Salesman

Sales

Index file

Index key

Pointer

Adam

Bobby

Fred

James

Josh

Khomsun

Ryan

Tim

White

Your program must let users to delete the existing records or tuples. After deletion, you should update the master and index files as follows:

Example: delete “Khomsun”

Master file

Rec#

Name

Position

Department

Tim

Clerk

HR

James

Officer

Stock

Adam

Manager

HR

White

Supervisor

Sales

Josh

Salesman

Sales

Ryan

Officer

Stock

Bobby

Clerk

HR

Fred

Salesman

Sales

Index file

Index key

Pointer

Adam

Bobby

Fred

James

Josh

Ryan

Tim

White

Your program must let user to update the existing records or tuples. User can change the attributes include the index key as well. After update, you should update the master and index files as follows:

Example: “Tim” changes name to “Jim”

Master file

Rec#

Name

Position

Department

Jim

Clerk

HR

James

Officer

Stock

Adam

Manager

HR

White

Supervisor

Sales

Josh

Salesman

Sales

Ryan

Officer

Stock

Bobby

Clerk

HR

Fred

Salesman

Sales

Index file

Index key

Pointer

Adam

Bobby

Fred

James

Jim

Josh

Ryan

White

Your program must let user to search the existing record or tuple by using an index key and list all of records order by the index key as the follows:

Example: Enter name: Bobby

Bobby Clerk HR

Enter name: Khomsun

Sorry, the record is not found!!

List all records:

Adam Manager HR

Bobby Clerk Stock

Fred Salesman Sales

James Officer Stock

Jim Clerk HR

Josh Salesman Sales

Ryan Officer Stock

White Supervisor Sales


Notes: Assume the index key cannot be duplicate. You can design the GUIs for this assignment as you prefer and it can be command line, window application or web-based application.