Question: Add a menu option: Enter new Person. This will need to: Get a new person from the keyboard. Create a new array, 1 cell bigger
Add a menu option: Enter new Person. This will need to:
-
Get a new person from the keyboard.
-
Create a new array, 1 cell bigger than the current array (call it tempPeople).
-
Use ArrayCopy to copy the old data to the new array.
https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#arraycopy(java.lang.Object,%20int,%20java.lang.Object,%20int,%20int)
-
Add the new person to the end of the array.
-
Assign the new array to the old reference:
people = tempPeople.
-
Repeat for EmployeeProgram.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
