Need help creating an Object in a class, and assigning values to the Member Functions
<p>Assignment details (my code is placed below):</p>

<p>Give a C++ class declaration called SavingsAccount with the following information: </p>

<p>Operations (Member Functions): </p>

<ol>
<li>Open account (with an initial deposit). This is called to put initial values in dollars and cents. </li>
<li>Make a deposit. A function that will add value to dollars and cents </li>
<li>Make a withdrawal. A function that will subtract values from dollars and cents. </li>
<li>Show current balance. A function that will print dollars and cents. </li>
</ol>

<p>Data (Member Data):</p>

<ol>
<li>dollars </li>
<li>cents </li>
</ol>

<p>Give the implementation code for all the member functions. </p>

<p>Write code that will create an object called bank1. The code will then initially place $200.50 in the account. The code will deposit $40.50 and then withdraw $100.98. It will print out the final value of dollars and cents. 
The following output should be produced: 
Dollars = 140 cents = 2.</p>

<p>NOTE: You must perform normalization on cents. This means that if cents is 100 or more, it must increment dollars by the appropriate amount. 
Example: if cents is 234, then dollars must be increased by 2 and cents reduced to 34. </p>

<p>PART 2: Change the program to allow the user to input the initial values, deposit
and withdrawal.</p>

<p>I have the code figured out for PART 2, because I've done programs involving functions and user input before. But I can't figure out how to re-do the functions for PART 1 to place pre-assigned numbers in the Dollars and Cents variables, and make the other functions still work correctly to get the correct balance at the end</p>

<p>Here's my code:</p>

<pre><code>// PART 2: Allow the USER to input Initial, Deposit, and Withdrawl values.
// NOTE: You must perform normalization on cents. This means that if cents is
// 100 or more, it must increment dollars by the appropriate amount. Example: 
// if cents is 234, then dollars must be increased by 2 and cents reduced to 34.

#include &lt;iostream&gt;
using namespace std;

// SavingsAccount class declaration:
class SavingsAccount 
{
    private:
        int dollars;
        int cents;

    public:
        void setOpen(int, int);
        void setDeposit(int, int);
        void setWithdrawl(int, int);
        void showBalance();

};

//*******************************************************
// setOpen function, allows user to open a new Account **
//*******************************************************
void SavingsAccount::setOpen(int d, int c)
{
    dollars = d;
    cents = c;
    cout &lt;&lt; "Input Dollars for Opening Balance:" endl;
    cin &gt;&gt; "$" &gt;&gt; dollars;
    cout &lt;&lt; "Input Cents for Opening Balance:" endl;
    cin &gt;&gt; "." &gt;&gt; cents;
    // Normalize dollars and cents
    while(cents &gt;=100)
    {
        cents-=100;
        dollars++
    };
};

//************************************************************
//setDeposit function, adds a Deposit to the user's Account **
//************************************************************
void SavingsAccount::setDeposit(int d, int c) 
{
    dollars = d;
    cents = c;
    cout &lt;&lt; "Input Dollars to Deposit:" endl;
    cin &gt;&gt; "$" &gt;&gt; dollars
    cout &lt;&lt; "Input Cents to Deposit:" endl;
    cin &gt;&gt; "." &gt;&gt; cents
    dollars += d;
    cents += c;
    // normalize dollars and cents
    while(cents &gt;= 100) 
    {
        cents -= 100;
        dollars++;
    };
};

//*******************************************************************
// setWithdrawl function, withdrawls money from the user's Account **
//*******************************************************************
void SavingsAccount::setWithdrawl(int d, int c)
// normalize dollars and cents
{
    dollars = d;
    cents = c;
    cout &lt;&lt; "Input Dollars to Withdrawl:" endl;
    cin &gt;&gt; "$" &gt;&gt; dollars;
    cout &lt;&lt; "Input Cents to Withdrawl:" endl;
    cin &gt;&gt; "." &gt;&gt; cents;
    while(c &gt;=100) 
    {
        c -= 100;
        d++;
    };
     if(c &gt; cents) 
    {
        dollars--;
        cents += 100;
    };
    dollars -= d;
    cents -= c;
};

//******************************************************************
// showBalance function, shows the user's current account balance **
//******************************************************************
void SavingsAccount::showBalance()
{
    cout &lt;&lt; "Your current balance is: $" &lt;&lt; dollars &lt;&lt; "." &lt;&lt; cents &lt;&lt; endl;
};
//******************
// Function Main  **
//******************

int main()
{
    char answer;    // To hold Y or N input.

    cout &lt;&lt; "This program will help you open and manage a new Savings Account!" endl;
    SavingsAccount::setOpen(int d, int c);

    cout &lt;&lt; "Do you wish to make a Deposit?" endl;
    cout &lt;&lt; "Press 'Y' for Yes, and 'N' for No." endl;
    cin &lt;&lt; answer;
    do 
    {
        SavingsAccount::setDeposit(int d, int c);
    } while (answer = 'Y' || answer = 'y';

    cout &lt;&lt; "Do you wish to make a Withdrawl?" endl;
    cout &lt;&lt; "Press 'Y' for Yes, and 'N' for No." endl;
    cin &lt;&lt; answer;
    do 
    {
        SavingsAccount::setWithdrawl(int d, int c);
    } while (answer = 'Y' || answer = 'y';

    SavingsAccount::showBalance();

    return 0;
};
</code></pre>
