Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(c++) Show the output produced when the following code (entire program not shown) is executed. You are encouraged to also try to compile this in
(c++) Show the output produced when the following code (entire program not shown) is executed. You are encouraged to also try to compile this in a program to verify your results.
code:
string name = "Jeffery Tambor"; cout << "NAME = " + name << endl; cout << name.length() << endl; name.erase(8, 6); cout << name << endl; name.append("Dean WD Morgan"); cout << name << endl; name.insert(22, "@TWD"); cout << name << endl; name.replace(23, 3, "The WD"); cout << name << endl; cout << name.find("WD") << endl; cout << name.rfind("WD") << endl; cout << name.rfind("fery") << endl; for (int i = name.length(); i > 20; i--) cout << name[i-1]; cout << endl;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started