Question: in c++ Read in a 2-character string from input into variable userPassword. Declare a boolean variable hasLowercase and set hasLowercase to true if userPassword contains
Read in a 2-character string from input into variable userPassword. Declare a boolean variable hasLowercase and set hasLowercase to true if userPassword contains a lowercase letter. Otherwise, set hasLowercase to false. Ex. If the input is jJ, then hasLowercase is assigned with true, so the output is: Password is valid Ex. If the input is 82 , then hasLowercase is assigned with false, so the output is: Password is not valid Note: Use getline(cin, userPassword) to read the entire line from input into userPassword. 1 \#include 3 \#include 4 using namespace std; 5 int main( \{ 6 ing userPassword; 7 string 8 s K * Your code goes here "/ if (hasLowercase) \{ cout "Password is valid" endl; \} else \{ cout "Password is not valid" endl
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
