password and username program
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
This is what i need to write for my script and i cant seem to even get started, maybe some one can give me an out line on how to get started of something. that would be great thanks.
"Write a program that error checks user input. The user will enter a username, a password and a number, your program will check to make sure the information entered is valid and display a message telling the user. Use the user name in the prompt to get the number. The criteria are as follows: Username Must be at least 6 characters long Must begin with a letter Can have letters and numbers but no special characters Password Must be at least 8 characters Must have at least one capital letter and one number Is case sensitive Verify by having user type it twice and check to see if it matches Number Must be a valid number that could be used in a calculation Cannot have letters or special characters"
0 Kommentare
Antworten (1)
Chad Greene
am 29 Okt. 2015
I'd start with inputdlg. The first example in the documentation shows how to make the user enter two inputs. You'll have to modify it to make sure the user enters three inputs.
For error checks, I'd use isnumeric(number) to verify that the number is a number. You can do ~isnumeric(username) to verify that the username is not a number. And I'd use regexp to verify that special characters are present in the password.
Good luck!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!