Write a program to get an employee ID and a password from a user.
An ID is valid if it is a 7 digit number (and the first digit can't be 0).
A password is valid if it meets the following two criteria:
First draft of code:
done = 0; id = input('Enter your employee ID: '); while ~done if id < 1000000 || id > 9999999 id = input('Invalid ID. Enter your ID: '); else done = 1; end end done = 0; while ~done passwd = input('Enter your password: ', 's'); if length(passwd) < 6 || length(passwd) > 10 disp('invalid – bad length') elseif ~( isletter(passwd(1)) || passwd(1) == '_' ) disp('invalid – must start with letter or _') else done = 1; end end
What user input should be used to have adequate test coverage?
positive test cases
negative test cases
boundary test cases
set breakpoint
step through code
step over function
step into function
step out of function
continue to next breakpoint
see variable values