Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Language: C++ Create a class called Employee. The class should have the following members firstName: string lastName: string pay: int Create a dynamically allocated array
Language: C++
Create a class called Employee. The class should have the following members firstName: string lastName: string pay: int Create a dynamically allocated array of n employee variables where n is a number entered by the user. Validate the input until a positive integer is entered. Create a function that expects the array as input. The function populates the array with employee objects entered by a user by looping through the array and letting the user input the data for each employee. Create a second function that expects a pointer to the array as input and prints the elements in the array. Remember that arrays are passed by reference, that is, any modifications inside the function will be reflected in the caller's array. Call both functions from the main. Example Number of employees: Employee 1 First Name: Allen Last Name: Harper Pay: 1000 Employee 2 First Name: John Last Name: Doe Pay: 500 Employees: Name Allen Harper (1000) Name: John Doe (500)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