Question: You need to write a class, named Penultimate. This class has just one method ( member function ) named push _ back, that takes a
You need to write a class, named "Penultimate". This class has just one method member function named pushback, that takes a string and returns a string. The string returned by pushback is the string that was provided to pushback in the previous call of the method or the string provided to the constructor if this is the first call to pushback.
Example:
Penultimate pfirst;
string s ppushbacksecond; s is "first"
ppushbackThird; returns "second"
ppushbacklast; returns "Third"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
