I need to create a program that will accept values from users (name, age, bday, etc) and save these values in an array. Pretty easy right? But my problem is I want it to be able to save more than one set of inputs. I'm thinking of using a 2d array for this.
Example:
Element 0,0 will hold the value name1, 0,1 age1, 0,2 bday1
Element 1,0 will hold the value name2, 0,1 age2, 0,2 bday3
and so on... the user must be able to input as many sets of names, ages, and bdays as possible.
Then another functionality I need is that the program must be able to ask the user to input a searchKey, then the program will loop through the values of the 2d array until it finds that searchKey.
When it finds it, the user must be able to delete the entire row.
ex. searchKey == name1.
When the program finds name1, the program must delete everything else in its row. (age1, bday1)
My question is.
- Is it possible to do that using arrays only?
- How?
Note: I'm not asking for a complete code. Just a clue on how should I do it would be greatly appreciated. Thanks!