Home / Expert Answers / Computer Science / 3-15-1-nbsp-character-operations-nbsp-c-nbsp-a-3-character-string-passcode-is-read-from-in-pa880

(Solved): 3.15.1: Character operations. C++ A 3-character string, passCode, is read from in ...



3.15.1: Character operations. 

C++ 

A 3-character string, passCode, is read from input. Replace each character in passCode that is not a digit with '$'. Otherwise, passCode is not changed.

Ex: If the input is q22, then the output is:

$22

 

confused on how to input the replacement character 

 

CHALLENGE
ACTIVITY
3.15.1: Character operations.
A 3-character string, passCode, is read from input. Replace each character i

CHALLENGE ACTIVITY 3.15.1: Character operations. A 3-character string, passCode, is read from input. Replace each character in passCode that is not a digit with 'S'. Otherwise, passCode is not changed. Ex: If the input is q22, then the output is: \( \$ 22 \) 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() \{ 7 string passCode; \( \begin{array}{ll}8 & \text { getline(cin, passCode); }\end{array} \) \( 10 \quad \gamma^{*} \) Your code goes here */ 12 cout \( \ll \) passCode \( \ll \) endl; 14 return 0 ;


We have an Answer from Expert

View Expert Answer

Expert Answer


A 3-character string, passCode, is read from input. Replace each character in passCode that is not a dig

We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe