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 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 \}?