// // p.19-20 // #include using namespace std; class MoneyType { public: void Initialize(long, long); long GetDollars() const; long GetCents() const; private: long dollars, cents; }; void MoneyType :: Initialize(long d, long c) { dollars = d; cents = c; } long MoneyType :: GetDollars() const { return dollars; } long MoneyType :: GetCents() const { return cents; } int main() { // test code goes here // delcare obj. MoneyType money; int dollar, cent; cout << "Input your dollar amount? "; cin >> dollar; cout << "Your cents? "; cin >> cent; // To init. the obj? //money.Initialize(20, 25); money.Initialize(dollar, cent); // out cout << "\n\nYour input: $" << money.GetDollars() << "." << money.GetCents() << endl << endl; return 0; }