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

*MATLAB* Write a script that will ask for password (Choose an arbitrary password

ID: 3735344 • Letter: #

Question

*MATLAB* Write a script that will ask for password (Choose an arbitrary password for your script). If the password is incorrect, it will ask again up to three times and then exit the script with an appropriate message. If the password is correct, it will then go to the script that you wrote in Section V problem 4.

the script in section V problem 4 is: Write a script area_menu that will print a list consisting of cylinder, circle, and rectangle. It prompts the user to choose one, and then prompts the user for the appropriate quantities (e.g., the radius of the circle) and then prints its area. If the user enters an invalid choice, the script simply prints an error message. The script should use a nested if-else statement to accomplish this. Here are two examples of running it (units are assumed to be inches).

Explanation / Answer

function password() X = inputdlg('PLEASE ENTER THE PASSWORD TO PROCEED'); x = str2double(X{1,1}); password = 123; % SET IT HERE MANUALLY if (x == password) uiwait(msgbox('Password Correct !!')); else while (x ~= 123) if (x == password) uiwait(msgbox('Password Correct !!')); break; else uiwait(errordlg('Incorrect Password !!')); X = inputdlg('PLEASE ENTER THE PASSWORD TO PROCEED'); x = str2double(X{1,1}); end end uiwait(msgbox('Password Correct !!')); end %areaMenu %This script asks the user for a type of area %and prints the area using if-else %units are assumed to be inches. i=1; while( i==1 || i==2 || i==3) %display a menu disp('Menu'); disp('1. Cylinder'); disp('2. Circle'); disp('3. Rectangle'); %choice selection i=input('Please select your choice now: '); if i==1 disp('well! your choice is cylinder'); r=input('enter radius: '); %error check while(r