Please help with writing this code. The language is C++. I'm using vim. Thanks


Code:
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
string randomString(int length, string charIndex){
int ri[length];
for (int i = 0; i < length; ++i){
ri[i] = rand() % charIndex.length();
}
string rs = "";
for (int i = 0; i < length; ++i){
rs += charIndex[ri[i]];
}
if (rs.empty()) randomString(length, charIndex);
else return rs;
}
int main()
{
srand(time(NULL));
int length;
int lettersConfirm;
int uppercaseLettersConfirm;
int lowercaseLettersConfirm;
int numbersConfirm;
string finalString="";
cout << "How long do you want the password be: ";
cin >> length;
cout << "Do you want letters (0-No, 1-Yes)? ";
cin >> lettersConfirm;
if(lettersConfirm == 1){
cout << "Do you want uppercase letters (0-No, 1-Yes)?
";
cin >> uppercaseLettersConfirm;
if(uppercaseLettersConfirm == 1){
cout << "How many characters should be upper case?";
int uppercaseCharNum;
cin >> uppercaseCharNum;
finalString +=
randomString(uppercaseCharNum,"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
}
cout << "Do you want lowercase letters (0-No, 1-Yes)?
";
cin >> lowercaseLettersConfirm;
if(lowercaseLettersConfirm == 1){
cout << "How many characters should be lower case?";
int lowercaseCharNum;
cin >> lowercaseCharNum;
finalString +=
randomString(lowercaseCharNum,"abcdefghijklmnopqrstuvwxyz");
}
}
cout << "Do you want numbers (0-No, 1-Yes)? ";
cin >> numbersConfirm;
if(numbersConfirm == 1){
cout << "How many characters should be number?";
int numbersCharNum;
cin >> numbersCharNum;
finalString += randomString(numbersCharNum,"0123456789");
}
cout << "Your random password is: " << finalString
<< endl;
}
Output:
How long do you want the password be: 10 Do you want letters (0-No, 1-Yes)? 1 Do you want uppercase letters (0-No, 1-Yes)? 1 How many characters should be upper case? 3 Do you want lowercase letters (0-No, 1-Yes)? 1 How many characters should be lower case? 3 Do you want numbers (0-No, 1-Yes)? 1 How many characters should be number? 4 Your random password is: BBRiae9089
Please help with writing this code. The language is C++. I'm using vim. Thanks Problem Statement...
Write a function in Java to generate a password and test whether it meets specific complexity criteria. Be creative with how you generate passwords - strong passwords have a mix of at least three of these attributes - lowercase letters, uppercase letters, numbers, and symbols. You can even prompt the user to ask them the strength of the password and adjust what is generated as an enhancement if you like. The passwords should be random, generating a new password every...
2. You are making a new account on your favorite social media website. This great new website offers the most fun way to steal all of your personal information! Long story short, you need a new password. ords can include upper-case letters, lower-case letters, numbers and the symbols you can r. Characters may be repeated. Please do not simplify your answers. get by holding Shift + a numbe (a) Suppose you want to make a 7, 8 or 9-character long...
Homework: Homework 11.6 - 11.9 Score: 0 of 1 pt + 9 of 22 (1 complete) 11.7.27 A three-character password to log onto a computer is drawn from the digits 0-9 and a subset of 18 letters of the alphabet (repetition is permitted). Determine the number of passwords possible it a) the letters used are not case sensitive (that is a lowercase letter is treated the same as an uppercase letter) b) the letters used are case sensitive (that is,...
Compute the number of passwords of each type below along with how long it would taketo test all possible such passwords if it takes 1 nanosecond to test a password. Report the times in the most convenient human understandable form. In all of these, unless noted otherwise, order matters and repetition of characters is allowed. Passwords of length 8 with any combination of lowercase letters, uppercase letters,and numbers. Passwords that start with a capital letter, have 10 lowercase letters, and...
Write a program that asks the user to enter a password, and then checks it for a few different requirements before approving it as secure and repeating the final password to the user. The program must re-prompt the user until they provide a password that satisfies all of the conditions. It must also tell the user each of the conditions they failed, and how to fix it. If there is more than one thing wrong (e.g., no lowercase, and longer...
In Java, I have created a program which can generate passwords. Currently the program can generate a password through a menu system of which characters to use. To complete the project, I need a system which allows the user to generate another password after the first password is created. I also need a method to check whether or not the password is complex by checking if the generated password has 3 or more character types and then displaying whether or...
Create a python script in Pycharm: 1) For your script you will need to get input from a user, which will ask them to enter a password to be reviewed. This needs to be outside of your functions that you will create for your script. You will be passing the value of the user’s password entered as a parameter value to your functions. You will be creating four separate functions, you will have one function that verifies whether the user’s...
Part 1: Is this Crazy Password Valid? A good password (in this strange system) should have the following properties: Rule 1: The password should be between 4 and 25 characters inclusive, starting with a letter. Rule 2. The password should not be contained in a list (selected by the user) that contains passwords commonly used by many people thus making these passwords easy to guess. Comparisons with passwords from the list of common passwords should be case insensitive. For example,...
JAVA PROBLEM! PLEASE DO IT ASAP!! REALLY URGENT! PLEASE DO NOT POST INCOMPLETE OR INCORRECT CODE Below is the program -- fill the code as per the instructions commented: //---------------------------------------------------------------------------------------------------------------------------------------------------------------// /* The idea of this HW is as follows : A password must meet special requirements, for instance , it has to be of specific length, contains at least 2 capital letters , 2 lowercase letters, 2 symbols and 2 digits. A customer is hiring you to create a class...
Please do question 19 and 27. Please show all work 19) A) How many different area code 909 telephone numbers are possible? Assume that the first digit of any phone number cannot be 0 or 1. ) B) Suppose a computer requires eight characters for a password. The first three characters must be letters and the remaining five characters must be numbers. How many passwords are possible? 27) In how many ways can 8 people be arranged for a photograph...