+ 2
How can I make a program with loops, for a user to enter an account number?
if the user input characters instead of Numbers how can I use loops to prompt the user to enter an account number?
2 odpowiedzi
+ 22
In my quasi-pseudocode:
1.) Declare any variables(i.e.int,char,double)
2.) Maybe use a do while loop(so any residual actions are executed)
3.) Use cout to ask for data from the user.
4.)Store it in a cin variable, or do something with the data like check for int/char input, or if account string exists, and notify user in case of faulty input
5.)Close with a cout "Would you like to alter more data? Press y for yes, and n for no: "
6.)cin for yes or no.
7.) Do while loop will check for y or n
8.) cout "Exiting...", and then exit, or go back to step 3.