password and username program

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"

Respuestas (1)

Chad Greene
Chad Greene el 29 de Oct. de 2015

0 votos

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!

Categorías

Más información sobre Characters and Strings en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Oct. de 2015

Respondida:

el 29 de Oct. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by