Summation and multiplication of digits of a number This program takes digits of a number and calculate summation and multiplication of its digits .How can I make this code more OOP ?

//Calculate Sum and multiplication of digits of a number .

#include "stdafx.h"
#include &lt;iostream&gt;
#include &lt;vector&gt;

using std::cout;
using std::cin;
using std::endl;
using std::vector;

int main()
{
    int number , sum = 0 , multp = 0 ;
    vector&lt;int&gt; digits;

    cout &lt;&lt; "Calculate Sum and multiplication of digits of a number ." &lt;&lt; "\n" &lt;&lt; "\n";
    cout &lt;&lt; "------------------------------------" &lt;&lt; "\n";
    cout &lt;&lt; "Enter a whole number : ";

    cin &gt;&gt; number;

    if (number &gt; 0)         //Condition for inputed number
    {

        while (number)
        {
            digits.push_back(number % 10);
            number /= 10;
        }


        for (int i = 0; i &lt; digits.size(); i++) // summation
        {
            sum += digits[i];
        }
        cout &lt;&lt; "sum of digits = " &lt;&lt; sum &lt;&lt; "\n";

        for (int j = 0; j &lt; digits.size(); j++) //multiplication
        {
            multp *= digits[j];
        }

        cout &lt;&lt; "Multiplication of digits = " &lt;&lt; multp &lt;&lt; "\n";
    }


    else
    {
        cout &lt;&lt; "Pleas enter a positive number ." &lt;&lt; "\n";
    }


    cout &lt;&lt; "\n" &lt;&lt; "\n" &lt;&lt; "------------------------------------" &lt;&lt; "\n";
    system("pause");
    return 0;
}


Thanks in advance.
Using std::accumulatewould be more idiomatic. Also use auto whenever possible.

#include &lt;algorithm&gt;
#include &lt;functional&gt; // requires C++14, else use a lambda for the predicate
auto sum = std::accumulate( digits.cbegin(), digits.cend(), 0 );
auto prod = std::accumulate( digits.cbegin(), digits.cend(), 1, std::multiplies&lt;&gt;);




Comment on the accepted answer, which I at first mistook for an edit of the question:


Class names should be nouns, function names should be verbs. As in DigitsCalculator.
Your no argument constructor can be written as CalcDigits = default.
Having a setter and getter for a private variable effective eliminates the encapsulation. There are divergent opinions on this topic. Some say a setter is better, because you can add logic for accessing the variable later. I, personally, have never "added logic" to a setter, and would just make the variable public.
You have an invariant: CalcDigits c; c.SetNumber(42); c.GetSum(); c.GetMul();. Interfaces should be "easy to use correctly, difficult to use incorrectly.
Overall, I like the new look better. You have separation of concerns (command line communication and actual calculation). You also have an encapsulated object, that you can pass around with clear intent.