Passing Parameters
This is the basic passing parameters code. The function has "(name)" after it this is because that is the variable that needs to be substituted from the main part of the program where the user inputted it.
In the main part of the program the variable "(name)" is called "(enteredname)
Passing Parameters 2
This is when I have developed my program further. Firstly I have added 3 lists, the studentlist, usernamelist and passwordlist. Whatever the user enters for fullname, username and password will be saved in these lists.
We also have a loop in this, this improves the program as then the user can add as many records as they want until they want to stop. This is because we have named a variable called "restart" this is set to "y" as its starting value. Then I have added a while loop so while that condition is true then the loop will continue however if it is not true then the program will stop and no more records will be added.
However there is a flaw in this code as if you type "y" when it asks you "Do you want to make another record y or n?") if you type in anything other than "y" the program will stop working.


No comments:
Post a Comment