Modify the SalesClerks program so the SalesClerk array length always equals the current number of sales clerks.

Question:

  1. Modify the SalesClerks program so the SalesClerk array length always equals the current number of sales clerks. That means the initial length of the SalesClerks array should be zero. Because the current number of sales clerks always equals clerks.length, dispense with the filledElements variable. Also dispense with the doubleLength method, and do the job of incrementing the length of the clerks array in the addSale method, mostly within the block under:
  2. if (clerkIndex == -1}.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: