password and username program
9 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Chad Greene
2015 年 10 月 29 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!