Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

USE Matlab script / code ONLY ! Write a short script that would prompt a user to

ID: 1716385 • Letter: U

Question

USE Matlab script / code ONLY !

Write a short script that would prompt a user to input a password and check it against stored password data. For this porblem, you may assume that the user data has already been loaded into your workspace by an appropriate filed read command and saved as some variable name. The format of the file is "Password, first_name'.

Write a short script (matlab) for 5-8 lines that prompts the user to enter a password, and provides feedback as to whether they have been granted access to their account. Note, this program was run two times.

>>test_question

please input your password: test 1

incorrect password

>> test_question

please input your password: Correct

hello, world

Explanation / Answer

clc

userdef='admin';

% you can remove userdef if needed.

passdef='Correct';

userin=input(' Username: ','s');

passin=input(' Password: ','s');

a=length(userin); a1=length(userdef);

b=length(passin); b1=length(passdef);

if(a==a1 & b==b1)

end

% Thats the program.