Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with my c++ assignment. Write a program that will read records from the file employee.in and store them in a binary file

I need help with my c++ assignment.

Write a program that will read records from the file "employee.in" and store them in a binary file. That file will then be used as input to create an output file of the information. The data file contains employee information consisting of name, social security, department ID, years employed, and salary. In addition to displaying the information of each record, the program will also calculate the average salary and years employed of all the records. This additional information is stored in the same output file.

\

\

\

employee.in

Bill Tarpon 182460678 789 8 30600 Fred Caldron 456905434 789 10 40700 Sally Bender 203932239 790 8 50000 David Kemp 568903493 790 9 60000

/

/

/

Do I have to read them first then write them out, then read the output file again? Like

ifstream fin;

fin.open("employee.in"); // read first

ofstream worker("employeeOut.dat", ios::binary); // write them output

ifstream reader("employeeOut.", ios::binary); //read back the output file

please provide me a full length code. Thank you

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

Distinguish profit sharing from gain sharing.

Answered: 1 week ago

Question

How is the NDAA used to shape defense policies indirectly?

Answered: 1 week ago