Question
Request a template in c++. Please do not use vectors or tokens for the requirements. There are no member functions for Instructor so a struct
Request a template in c++. Please do not use vectors or tokens for the requirements.
There are no member functions for Instructor so a struct is probably a better choice. There are some differences between the input fields and the form of the Instructor members. The Instructor ID field in the input is an example of a coded key. It may look like a 9-character ID, but in reality it contains two distinct fields. The first three characters are a payroll code. The next six characters are a unique number. You may assume that the numbers are assigned such that every instructor has a unique 9-character ID. The salary is a whole number (no decimal places). Use a properly-structured loop (as we discussed in class) to read the input file until EOF. Use the read function to read each record into a character array large enough to hold the entire record. For each record, dynamically allocate and populate an Instructor object. Use a pointer array to manage all the created Instructor objects. Note that to populate some of the Instructor fields, youll need to perform a conversion of some type. Assume that there will not be more than 99 input records, so the size of the pointer array will be 100. Use a global variable to define the size of the pointer array. Initialize each element in the array of pointers to nullptr. As you read input records and create new Instructor objects, point the next element in the pointer array at the new object. Later, when you loop through the pointer array to process the objects, youll know that there are no more when you come across a pointer with a null value. This way, the pointer array is self-contained and you dont need a counter.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started