Find Jobs
Hire Freelancers

MATLAB Project Code (Random Password Generator) -- 2

$10-30 USD

已关闭
已发布超过 3 年前

$10-30 USD

货到付款
I NEED HELP ASAP. Please find any errors in the code, let me know if there should be anything removed or added specifically. If something needs to be added please specify the exact code needed. I am looking for ways I can make this code better or analyze what I can remove. CODE: rand('twister', sum(100*clock)); %{ Define data sets %} % Edit these sets as needed up = ['A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'... 'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z']; low = ['a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'... 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z']; nums = ['0' '1' '2' '3' '4' '5' '6' '7' '8' '9']; special = ['!' '@' '#' '$' '%' '^' '&' '*' '_' '-' '+' '=' '' ':' ';' '.' ',']; %{ Prompt for minimum password length %} minimum = input('Please enter the minimum password length: '); %{ Prompt for maximum password length %} maximum = -1; while (maximum < minimum) maximum = input('Please enter the maximum password length: '); end %{ Calculate password length %} pass_length = ceil((maximum - minimum + 1) * rand) + minimum - 1; fprintf('\nThe password length will be %d characters long.\n\n', pass_length); %{ Prompt for minimum number of uppercase letters %} requirement(1) = inf; while (requirement(1) > pass_length) requirement(1) = input('Please enter the minimum number of uppercase characters: '); end req1 = requirement(1); %{ Prompt for minimum number of lowercase letters %} requirement(2) = inf; while (requirement(2) > (pass_length - requirement(1))) requirement(2) = input('Please enter the minimum number of lowercase characters: '); end req2 = requirement(2); %{ Prompt for minimum number of numbers %} requirement(3) = inf; while (requirement(3) > (pass_length - requirement(1) - requirement(2))) requirement(3) = input('Please enter the minimum number of numerical characters: '); end req3 = requirement(3); %{ Prompt for minimum number of special characters %} requirement(4) = inf; while (requirement(4) > (pass_length - requirement(1) - requirement(2) - requirement(3))) requirement(4) = input('Please enter the minimum number of special characters : '); end req4 = requirement(4); %{ Compute password %} % character counter i = 1; password = ''; up_count = 0; low_count = 0; nums_count = 0; special_count = 0; while i <= pass_length % produce a random number from 1 to 4 select = ceil((4) * rand); if (requirement(select) > 0) || ((pass_length - i + 1 - requirement(1) - requirement(2) - requirement(3) - requirement(4)) > 0) switch select % uppercase case 1 password(i) = up(ceil((length(up)) * rand)); up_count = up_count + 1; % lowercase case 2 password(i) = low(ceil((length(low)) * rand)); low_count = low_count + 1; % number case 3 password(i) = nums(ceil((length(nums)) * rand)); nums_count = nums_count + 1; % special character case 4 password(i) = special(ceil((length(special)) * rand)); special_count = special_count + 1; end i = i + 1; % if it satisfies a requirement decrement if (requirement(select) > 0) requirement(select) = requirement(select) - 1; end end end %{ Display results %} if (req1 <= up_count) && (req2 <= low_count) && (req3 <= nums_count) && (req4 <= special_count) fprintf('\nAll requirements satisfied!\n'); fprintf(' - %d uppercase characters\n', up_count); fprintf(' - %d lowercase characters\n', low_count); fprintf(' - %d numerical characters\n', nums_count); fprintf(' - %d special characters\n\n', special_count); fprintf('The password is: %s\n\n', password); else disp('One or more requirements were not satisfied!'); end
项目 ID: 28216755

关于此项目

4提案
远程项目
活跃3 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
4威客以平均价$38 USD来参与此工作竞价
用户头像
Dear client" I have read your project description about" MATLAB Project Code (Random Password Generator) -- 2" and I'm confident i can do this project for you perfectly.I still have a few questions. please leave a message on my chat so we can discuss the budget and deadline of the project. Thanks. ..If this project is deleted hire me directly in my profile https://www.freelancer.com/u/johnwanjiku
$75 USD 在7天之内
4.9 (11条评论)
4.6
4.6
用户头像
---I CAN DO IT---- I read your project carefully and I can help you. I am Matlab expert. and I have 10+years experience in c, c++,etc. u can see my review. please chat with me. thank you
$20 USD 在1天之内
5.0 (16条评论)
3.5
3.5
用户头像
i m working in Matlab programming and i build many projects and dissertation in it. i have good knowledge for mathematics and i m a good programmer to do it. plz give me a chance to work with u
$35 USD 在1天之内
0.0 (0条评论)
0.0
0.0
用户头像
Hey there, I am a computer engineer and have completed various projects in Matlab. I can easily help you with your code and surely suggest you the best options to optimize your code. Thankyou!
$20 USD 在1天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
Chula Vista, United States
0.0
0
会员自11月 19, 2020起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。