ksteinberg6217 ksteinberg6217
  • 14-07-2017
  • Computers and Technology
contestada

Modify secondverse to play "the name game" (a.k.a. "the banana song", see wikipedia.org), by replacing "(name)" with username but without the first letter. ex: if username = "katie", the program prints:

Respuesta :

antonsandiego
antonsandiego antonsandiego
  • 21-07-2017
I guess you need to write it using C++, so here's your solution:
int main() {   string secondVerse = "Banana-fana fo-f(Name)!";   string userName = "Kattie";
   userName.erase(userName.begin());
userName.resize(userName.length()); secondVerse = secondVerse.replace(secondVerse.find("(Name)"),6 ,userName);
cout << secondVerse << endl;

 return 0;
}

 "userName.erase(userName.begin());" - this one removes first letter of the name.
Answer Link

Otras preguntas

Is this a function???????
Nineteen less than two-sevenths times a number is more than negative one. Which inequality BEST represents this situation?
10. Ron’s father finally installed cruise control on their flying car. He was having trouble because he kept of forgetting that he needed to balance out the opp
HELP ASAP PLEASE I NEED HELP TO ANSWER ALL OF THESE
Explain the three different "versions" of man that are created and why the first two versions were not acceptable to the gods.
Joe tells Pip's convict about the stolen food: "God knows you're welcome to it—so far as it was ever mine," returned Joe, with a saving remembrance of Mrs. Joe
A square filed has an a area of 1255 squared yards. About how long is each side of the filed? I know the answer is not 31375 and I also know that divided it by
Please select the best answer from the choices provided
solve for AE what is the aswer
Solve for PB. what is the aswers