Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a c++ program that inputs an unknown number of records from a sequential file. Use the following structure definition in your program. Write a

Write a c++ program that inputs an unknown number of records from a sequential file.

Use the following structure definition in your program.

Write a c++ program to create a hash table (containing 17 slots to store records) store the records using account_num as the key field. Use the method called linear probing to handle collisions.

Record Description

char last_name [15];

char first_name[15];

int account_num; //key field

unsigned month;

unsigned day;

unsigned year;

float annual_salary;

char dept_code; // Note: may be enter in either upper or lower case

char phone_number[12];

sample data

Smith Joe 234 12 10 1990 45000.00 a 850-789-1234

Williams keth 310 01 19 1990 23500.00 B 895-422-9404

Option 1: Create Hash table and populate with data records from input file Named data_MST.

Option 2: Add a Record { Prompt user for each fieldvalidate month day and year}no duplicate recs

Option 3: Modify a record {Prompt user for phone number to modify (must enter 10 digits only)

Option4: Delete {Prompt user for account number to delete must exist to delete}

Option5: Print report

Option 6: quit {dump records from hash table back to file named data_MST then terminate program

Print the following report.

Employee Report

**************

Last Acct date of annual department

Name Number birth salary code age

Smith 234* Dec. 10, 1990 $45,000.00 A 23

Williams 310 Jan. 19, 1990 $23,500.00 B 24

Total Annual Salary $68,500.00

Total record count : 99

* indicates the record resulted in a collision when inserted into the hash table

Actual Data:

Harry Thomas 0456 01 01 1989 3455.90 d 850-789-1231 Johnson Mary 0212 01 12 12 1989 23432.90 d 885-909-3432 Tripp donals 0102 09 21 1987 39302.90 s 850-789-1230 Horse Driven 0989 11 13 1978 45000.00 a 850-767-1111 Ben Joe 0393 12 12 1989 34589.90 c 850-789-1233 Smith Joe 0234 12 10 1990 45000.00 A 850-789-1234 Willis Kee 0074 03 20 1980 23500.34 b 850-798-2143 Berg Mike 0111 10 05 1999 10000.09 c 850-879-4321 Harry Ralph 0010 10 08 1998 9000.99 V 850-978-1010 Jackson Kate 0101 10 10 1995 9890.98 t 850-777-1111 Jones Mark 9080 10 11 1959 101000.90 x 850-850-8500 Williams Ted 0989 01 01 1980 90939.09 a 901-983-9809 Howell Alice 0984 11 21 1986 22020.90 b 919-199-8439 Kelly Betty 0904 10 06 1994 90390.09 c 850-789-4321 Thompson Mark 888 10 09 1998 38494.98 c 850-879-3421 Hall Brook 0849 09 09 1999 98908.87 d 850-644-9898 Alex Reed 00112 11 03 1980 3339.00 d 895-799-9090 Mary Jane 103 11 02 1980 3993.09 c 989-909-9090 Kelly Mach 0075 10 30 1990 9939.99 i 989-090-0909 Harry Reed 0038 10 29 1990 9839.90 i 898-090-9999 Mark Hargrove 0258 11 01 1990 939.09 K 747-909-7383 Max Reed 068 11 01 1990 343.90 p 898-909-9090 Roe Moore 135 11 02 1995 893.90 t 909-909-9090 Maken John 201 01 01 1900 323.90 t 909-909-9090 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions