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().fix :#include #include #include using namespace std;int main() {string passCode;cin >> passCode;/* Your solution goes here */cout << passCode << endl;return 0;}

Respuesta :

CPED

Answer:

Following is given the code as required.

I hope it will help you!

Explanation:

Ver imagen CPED

To change the characters of a string, we simply iterate through the string. The index character of a string starts from 0 while the last character is n - 1.

Replace /*Your solution goes here */ with the following lines of code, where comments are used to explain each line.

//This checks if the first character of passCode is an alphabet

if(isalpha(passCode[0])){

If yes, the first character is updated to _

passCode[0] = '_';

}

//This checks if the second character of passCode is an alphabet

if(isalpha(passCode[1])){

If yes, the second character is updated to _

passCode[1] = '_';

}

Read more about character and strings at:

https://brainly.com/question/15062365