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++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr