[Solved] SOLVED:Laboratory Exercise Week 10 solution

30 $

File Name: SOLVED:Laboratory_Exercise_Week_10_solution.zip
File Size: 405.06 KB

SKU: [Solved] SOLVED:Laboratory Exercise Week 10 solution Category: Tag:

Or Upload Your Assignment Here:


Task One: DebuggingPrograms subtract.cpp and CSL.cpp contain various errors; syntax, logical and/or with respect to the sample output. Find and fix bugs in subtract.txt and CSL.txt.Task Two: Binary file I/OCreate a class named Employee in a file Employee.h. Data members include the Employee’s ID number, first and last names, and the hourly pay rate. Implement member functions include overload insertion (<<) operator in a file Employee.cpp. Implement main() function and other functions in a file EmployeeIO.cpp. Data of employees are stored in a BINARY data file edata.bin.In the main() function, if the binary file does not exist, you should create an empty binary file. Do not load all Employee records into the memory (such as arrays or other containers).Use advanced input / output functions (such as read(), write, seekp(), seekg()) and manipulators to add new employee record in the binary file, search a record from the file and update the data in the binary file. Declare and implement separate functions to perform following actions when the program prompts menu and a user input his / her choices.1. Add a new employee.2. Search an employee.3. Update an employee hourly pay rate.0. Exit.Input your choice:When the user chose 1, the program prompts input for an employee record and adds the record into the binary file edata.bin:Employee ID: 1001First name: AdamLast name: SmithPay rate /hour: 128.35A record has been added.Employee ID: 100First name: AliceLast name: SpringPay rate /hour: 135.75A record has been added.Employee ID: 1001The employee ID already exists.When the user chose 2, the program prompts input for an employee ID, searches the record from the binary file edata.bin and displays the formatted results:Employee ID: 100Employee ID: 100First name: AliceLast name: SpringPay rate/hour: $00135.75When the user chose 3, the program prompts input for an employee ID, searches the record from the binary file edata.bin and displays the formatted results, then ask the new value for hourly pay rate:Employee ID: 100Employee ID: 100First name: AliceLast name: SpringPay rate/hour: $00135.75New pay rate/hour: 145.38A record has been updated.When the user chose 0, the program terminated.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Laboratory Exercise Week 10 solution
30 $