Question: Write a C + + program that store Employee information creating an Employee array dynamically and reading the required information from the given Employee.txt file.

Write a C++ program that store Employee information creating an Employee array dynamically and reading the required information from the given Employee.txt file. Your code must satisfy the following requirements:
requirements
Employee struct: This struct must has the following attributes:
name (string)
id (int)
position (string)
dynamic_allocation : Define a dynamic_allocation function that receives the file path and the number of employees to be read. This function will store the read information in the dynamic memory array allocated. This function must return an Employee pointer.
update_employee_name : Define an update_employee_name function that receives four arguments. An Employee pointer, id_ given by the user, the
update_employee_name : Define an update_employee_name function that receives four arguments. An Employee pointer, id_ given by the user, the number of employees, and the new name. This function will look for the employee by it id and update the name by the given name.
Note: Check the unit test to find potential hints.
Output
Employee -0 Carlos 8967 Professor
Employee -1 Frederic 9087 Director
Employee -2 Nathalie 1234 Assoc-Director
Employee -3 Katerin 5647 Instructor
Employee -4 Camile 4539 Secretary
Write a C + + program that store Employee

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!