q1) Redefine CDAccount from Display 10.1 so that it is a class rather than astructure. Use the same member variables as in Display 10.1 but make themprivate. Include member functions for each of the...

1 answer below »
q1) Redefine CDAccount from Display 10.1 so that it is a class rather than astructure. Use the same member variables as in Display 10.1 but make themprivate. Include member functions for each of the following: one to returnthe initial balance, one to return the balance at maturity, one to return theinterest rate, and one to return the term. Include a constructor that sets all ofthe member variables to any specified values, as well as a defaultconstructor. Embed your class definition in a test program.


3. Define a class for a type called CounterType. An object of this type is usedto count things, so it records a count that is a nonnegative whole number.Include a default constructor that sets the counter to zero and a constructorwith one argument that sets the counter to the value specified by itsargument. Include member functions to increase the count by 1 and todecrease the count by 1. Be sure that no member function allows the valueof the counter to become negative. Also, include a member function thatreturns the current count value and one that outputs the count to a stream.The member function for doing output will have one formal parameter oftype ostream for the output stream that receives the output. Embed yourclass definition in a test program.


Answered Same DaySep 25, 2021

Answer To: q1) Redefine CDAccount from Display 10.1 so that it is a class rather than astructure. Use the same...

David answered on Sep 25 2021
163 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here