Question: C++ (String verification) Ask a user to enter a string. Your program will verify that users string meet the following criteria: -The string should be
C++ (String verification)
Ask a user to enter a string. Your program will verify that users string meet the following criteria:
-The string should be at least eight characters long.
-The string should contain at least one alphabet (a-z, A-Z).
-The string should have at least one digit (0-9).
-If a string does not meet the criteria, your program should display a message telling the user which requirement is not satisfied.
******************************************************************************
Hints: You may use the following string functions:
#include
s.length() // returns the length of string s
isdigit(s[k]) // returns true if the character s[k] is a digit,
// returns false otherwise
isalpha(s[k]) // returns true if the character s[k] is a
// letter, returns false otherwise
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
