Passing Parameters + 2D Arrays
*Sorry for my varaible and function names they don't go with the program
**Also it will help if you read my previous post before this as it is actually building on from there
The first part of this is exactly the same as my last post, the function does exactly the same thing as it did before. However this time I will be using 2D Arrays with this function as well. For this to work one list (which the studentlist) is outside the main program.
Then there is another list which is inside of the main program. This list is called "listinlist". Then I have done exactly what I explained in my last post except I am appending to the list which is insde the main program which is "listinlist". After the user has inputted the required enteries then I ran the printMail_MergeItems functions. This time though the records that have been entered will be saved in the list which is inside the functions, and that list will be saved inside the "studentlist".
The Last bit of my program will then be able to search the entries that have been entered and have been saved in the lists. To do this I made a variable called "printstudents" this asks for the user to input an integer, so the user will input the integer of the record they are looking for. The same thing has been done with the other variable though this will search for the record inside the first record.
For e.g someone has a fullname apple username banana and password orange. The printstudents variable will find this record which will contain all 3 of those things, the searchstudents variable will then find either the fullname, the username or the password.
The last bit which says print(studentlist[printstudents][searchstudents]) is actually just printing the record the user has asked to find.

No comments:
Post a Comment