Question
Below is my C++ code. Using Microsoft Visual Studio. Once I enter an invalid password it terminates, but it should let me re-enter a password
Below is my C++ code. Using Microsoft Visual Studio. Once I enter an invalid password it terminates, but it should let me re-enter a password until it is acceptable.
#include
void validatePassword(string str) {
bool uF=false, lF=false, dF=false, flag = true; if (str.length()
for (int i = 0; i = 'A' && str[i] = 'a' && str[i] = '0' && str[i]
int main() { cout > str; validatePassword(str); return 0; }
This is what it should look like, but mine will just terminate even if I enter an invalid password. I need to be able to re-enter a password and it needs to continue to loop until a correct password combination has been entered.
This is my output. It does not prompt me to re-enter a password. Everything else is fine.
O C:\Users\davyn\Documents\courses troy\l_2013\C++\Homework\student_work Debug\week2_sa... The password must have: at least 6 characters, at least one uppercase character, at least one lowercase character, at least one numeric digit Enter a password: asdf The password must be 6 or more characters long. The password must have : at least one uppercase character The password is not valid. Press any key to continue . . . . C:\Users\davyn\Documents\courses_troy\l_2013\C++\Homework student_work\Debug\week2_sa.. The password must have: at least 6 characters, at least one uppercase character, at least one lowercase character, at least one numeric digit Enter a password: I lovecato The password is valid. Press any key to continue .... Microsoft Visual Studio Debug Console -ox The password must have: at least 6 characters at least one uppercase character at least one lowercase character at least one numeric digit Enter a password: asfdo The Password must be 6 or more characters long The password must have at least one uppercase character The password is valid C:\Users\chris\Desktop\Troy\Computer Science 2 CS 2255\hw2\Debug\hw2.exe (process 14668) exited with code @. To automatically close the console when debugging stops, enable Tools->Options ->Debugging->Automatically close the conso le when debugging stops. Press any key to close this window
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started