Abstract Data Type

The purpose of this lab is to review Object concepts and implement operator overloading


Create a new object called twoChar that is a completely formed object (i.e., abstract data type).
  1. twoChar is to contain two data members:
    leftChar
    rightChar
  2. Write set and get methods for both left and right characters
  3. Write a print method to print twoChar
  4. Test it
  5. Create constructors:
    Set both characters
    Default to blanks
  6. Test it
  7. Create a read leftChar, read rightChar, and read twoChar methods that ask the user for the appropriate character(s)
    Did you think to have read twoChar call the other reads?
    Did you get rid of extraneous input (i.e, use getline and only take the first character input
  8. Test it
  9. Overload the + operator to concantenate leftChar and rightChar and return a string
  10. Test it
A solution is available
Now, change the Rational code so that method multiply is called "*"
Modify the main and test it