Question: wheres mt mistake? C++ pls Read in a 2-character string from input into variable passCode. Declare a boolean variable isvalid and set isValid to true




Read in a 2-character string from input into variable passCode. Declare a boolean variable isvalid and set isValid to true if the following conditions are met: - passCode does not contain two of the same character. - For alphabetic characters, passCode does not contain two of the same letter (regardless of case). Otherwise, set isvalid to false. Ex: If the input is 26 , then isvalid is assigned with true, so the output is: Good passcode Ex: If the input is Bb, then isvalid is assigned with false, so the output is: Bad passcode Note: Use getline(cin, passCode) to read the entire line from input into passCode. Ex: If the input is 28 , then isValid is assigned with true, so the output is: Good passcode Ex: If the input is Bb, then isValid is assigned with false, so the output is: Bad passcode Note: Use getline(cin. passCode) to read the entire line from input into passCode. Ex: If the input is 26 , then isValid is assigned with true, so the output is: Good passcode Ex: If the input is Bb, then isValid is assigned with false, so the output is: Bad passcode Note: Use getline(cin, passCode) to read the entire line from input into passCode. To check if passCode does not contain two of the same character, regardless of case, the toupper( function can be used to convert both characters to the uppercase version. Then, the two returned values are checked for equality. The tolower() function can also be used. Not all tests passed. 1: Compare output Input Your output 2. Compare output Input Your output 3. Compare output Input 4 Compare output Output differs, See highlights below. Input Your output Expected output 5. Compare output A Input Your output 6: Compare output Output differs, See highlights below. Input Your output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
