Home / Expert Answers / Computer Science / a-website-requires-that-passwords-only-contain-alphabetic-characters-or-numbers-for-each-characte-pa908

(Solved): A website requires that passwords only contain alphabetic characters or numbers. For each characte ...



A website requires that passwords only contain alphabetic characters or numbers. For each character in checkStr that is not a

A website requires that passwords only contain alphabetic characters or numbers. For each character in checkStr that is not an alphabetic character or number, replace the character with 'z'. Ex: If the input is \( 55 \% \$ \mathrm{D} \), then the output is: Valid password: 5szzD Note: - isalpha() returns true if a character is alphabetic, and false otherwise. Ex: isalpha('a') returns true, isalpha(' 8 ') returns false. - isdigit() returns true if a character is a digit, and false otherwise. Ex: isdigit(' 8 ') returns true. isdigit('a') false. 1 #include ?iostream? 2 #include ?string? 3 using namespace std; 4 int main() 6 string checkstr; 7 unsigned int \( i \); \( 9 \quad \) cin \( >> \) checkstr; \( 11 \quad / * \) Your code goes here */ 12 cout \( k< \) "Valid password: " \( << \) checkstr \( k< \) end1; 14 return \( \theta \); 16 \}?


We have an Answer from Expert

View Expert Answer

Expert Answer


The program source code after completing the required logic to correct the password is given below:
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe