I'm trying to write a program that lets the user to input the salaries of 10 employees into an array, then the program will do an error check to see which of the employee's salary information has "not been entered", which means, if zero is entered, it's still counts as an input and the information is stored.
Note: that employee "5" and "8" does not have any data input to them, while employee "6" has zero salary.
The problem for me is that, array elements are automatically assigned to zero if no values are inputted to that element. I planned to utilize the zeros to flag for the errors...but apparently, a user can input zero as the salary.
I would appreciate it very much if someone could give me a "hint" on how to flag for the empty inputs.
Hint: Have a parallel array that indicates data has been input. Initalize the parallel array to zero or bool false ... update as input is inserted to data array and use as a flag on output.
A struct/class is a more sophisticated encapsulation doing the same. Now have 3 choices. :)
PS and yet another option. Defaulted string array then convert to numeric as required.
omg...i've completely forgot about parallel arrays!
i've spent almost an hour thinking how to flag this....and you solved it in a few seconds. LOL, i love the community here!
struct is too high tech for me lol, so ill pass that, and string to int is too much work for the entire program with compounding interest rate calculations.