password and username program

9 visualizaciones (últimos 30 días)
cameron vandebrake
cameron vandebrake el 29 de Oct. de 2015
Respondida: Chad Greene el 29 de Oct. de 2015
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
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 Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by