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

Convert the Celsius temperature of the surface of the sun, which is 5,500°C, to degrees Fahrenheit.
an ______ is one of earth's major land ecosystem with it's own characteristics animals, plants,soil, and climate
An unknown compound does not dissolve in water, is a nonelectrolyte and has a low melting point. Would it be an ionic compound? Explain.
Will an object with a density of. 97 g/ml float or sink in water explain
the Mississippi river is especially important to farmers because... a) encouraged new settlers to come north on barges and steam boats. b) allowed them to ship
what are the similarities and differences between the two versions of War of the Worlds?
lori says that 8 is not a factor of 80 because 8 does not end in zero. Does Lori's statement make sense? Explain
7/10-1/2 in simplest form
an equation that states two ratios are equivalent
write 17/5 as a mixed number in simplest form?