Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a c++ program that inputs (at most 50) records from a sequential file. Use the following structure definition in your program. Write a c++

Write a c++ program that inputs (at most 50) records from a sequential file.

Use the following structure definition in your program.

Write a c++ program to insert the records into an ordered (maintain order at all times) (single) linked list (ordered by Last_name in alphabetical order). Then print the records starting at the head of the list and traversing to the end of the list. Years if service 0 5 4.5%, 6 10 12.5% 11- 15 30.85% 16 20 45.9% over 20 65.90% annual retirement salary. Department codes AC accounting MD medical EG engineering TE technical PP -physical plant St staff LW legal Rd research TT testing QC -quality control.

Validate the data in each record before storing it in the data structure, any record found to be in error write that record to a file called "error.dat" along with the reason for the error.

Struct listnode {

char last_name [15];

char first_name[15];

unsigned start_month;

unsigned start_day;

unsigned start_year;

unsigned end_month; // 0 if still active

unsigned end_day; //0 if still active

unsigned end_year; // 0 if still active

float annual_salary;

string dept_code; // Note: may be entered in either upper or lower case (two characters)

string email_address[25];

struct listnode *nextptr; //pointer to next node in list

}; // end structure listnode

sample data

print the following report.

Employee Report 08/31/2021

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

Last First Date of Annual Department Years Predicted/monthly

Name Initial Hire salary Title of service* Retirement

Smith J. Dec. 10, 1990 $45,000.00 Law 23 $9999.99

Williams K. Jan. 19, 1990 $23,500.00 Med 24 $9999.99

etc.

Total $999,999.99 $9999.99

Total records read 999

Total records processed 999

Total error records 999

*service rounded to the nearest year

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions