I'm having trouble with this problem
Modify secondVerse to play "The Name Game" (a.k.a. "The Banana Song"), by replacing "(Name)" with userName but without the first letter. Ex: if userName = "Katie", the program prints:
Banana-fana fo-fatie!
Note: The song verse may change, such as: Banana-fana fo-f(Name)!!! or Apple-fana fo-f(Name)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include <iostream>
#include <string>
using namespace std;
int main() {
string secondVerse = "Banana-fana fo-f(Name)!";
string userName = "Katie";
userName.erase(userName.begin()); // Removes first char from userName
secondVerse.replace(15,19,"f"+userName+"!"); //can only change this line
cout << secondVerse << endl;
return 0;
}
|
my output looks like this
(check)Testing Katie
Your output: Banana-fana fo-fatie!
(check)Testing Walter
Your output: Banana-fana fo-falter!
(X)Testing Katie and ending with !!! instead of !
Expected output: Banana-fana fo-fatie!!!
Your output: Banana-fana fo-fatie!
how do i get it to sometimes add !!!