I am working on an Employee Program. The user adds either a commissionEmployee,
ID: 3627320 • Letter: I
Question
I am working on an Employee Program. The user adds either a commissionEmployee, SalaryEmployee, or HourlyEmployee. So I get all that data and use a for loop to display everyone that has been entered into the program.However I have a submenu that will display only 1 type out of the 3. Ex:
1. Submenu
Display:
1. Hourly
2. Salary
3. Commission
Yes I know how to display every array I created of each type all at the same type. Yet I am not sure how to display only hourly or only salary or only commission??
Explanation / Answer
If you wish to only print one of the 3 arrays, instead of all then try using a switch statement to see which one the user wants to print and then print that one. Or you could use a if else statement if you prefer.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.