Question
C++ PROGRAMMING QUESTION: Create a struct called Employee. The struct should have the following members: firstName: string lastName: string pay: int Create a dynamic array
C++ PROGRAMMING QUESTION:
Create a struct called Employee. The struct should have the following members:
firstName: string
lastName: string
pay: int
Create a dynamic array of n employee variables where n is a number entered by the user. The loop through the array and let the user input the data for each employee. Create a function that expects a pointer to the array as input and prints the elements in the array. Remember that arrays are passed by reference, any modifications inside the function will be reflected in the caller's array.
Example:
Number of employees: 2
Employee 1
First Name: Barry
Last Name: Allen
Pay: 3000
Employee 2
First Name: Jessica
Last Name: Wilder
Pay: 6000
Employees:
Name: Barry Allen (3000)
Name: Jessica Wilder (6000)
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