Replace any alphabetic character with '_' in 2-character string passCode. Ex: If passCode is "9a", output is: 9_ Hint: Use two if statements to check each of the two characters in the string, using isalpha().

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter2: Basic Elements Of C++
Section: Chapter Questions
Problem 24SA
icon
Related questions
Question
100%
ACTIVITY
Replace any alphabetic character with L'in 2-character string passCode. Ex: If passCode is "9a", output is:
9.
Hint: Use two if statements to check each of the two characters in the string, using isalpha().
345154.2174782.qx3zqy7
1 #include <iostream>
2 #include <string>
3 #include <cctype>
4 using namespace std;
6 int main() {
string passCode;
7
8.
9.
cin >> passCode;
10
11
/* Your solution goes here
12
cout <« passCode << endl;
return 0;
13
14
15 }
MacBook Pro
Transcribed Image Text:ACTIVITY Replace any alphabetic character with L'in 2-character string passCode. Ex: If passCode is "9a", output is: 9. Hint: Use two if statements to check each of the two characters in the string, using isalpha(). 345154.2174782.qx3zqy7 1 #include <iostream> 2 #include <string> 3 #include <cctype> 4 using namespace std; 6 int main() { string passCode; 7 8. 9. cin >> passCode; 10 11 /* Your solution goes here 12 cout <« passCode << endl; return 0; 13 14 15 } MacBook Pro
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning