can you help me fix this code to make it better and more acceptable as per coding standards and such. im trying to get a good grasp of classes in c++
#include <iostream>
using namespace std;
class Calculator
{
private:
int number1;
int number2 ;
public:
Calculator setCalcNumbers(int input1 , int input2 )
{
number1 = input1;
number2 = input2;
}
int addNumber()
{
return number1 + number2;
}
int subtractNumber()
{
return number1 - number2;
}
int divideNumber()
{
return number1 / number2;
}
int multiplyNumber()
{
return number1 * number2;
}
};
int main()
{
int numberInput1 = 0;
cout << "Enter number 1: ";
cin >> numberInput1;
int numberInput2 = 0;
cout << "Enter number 2: ";
cin >> numberInput2;
Calculator t;
t.setCalcNumbers(numberInput1, numberInput2);
char userOperationChoice;
cout << "which operation would you like to perform? "
<< " , enter M for Multiplication, D for Division, A for addition or S for Subtraction:" << endl;
cin >> userOperationChoice;
char a,d,m,s;
switch (userOperationChoice)
{
case 'a' :
t.addNumber();
cout << "the total is: " << t.addNumber() << endl;
break;
case 's':
t.subtractNumber();
cout << "the total is: " << t.subtractNumber() << endl;
break ;
case 'd':
t.divideNumber();
cout << "the total is: " << t.divideNumber() << endl;
break;
case 'm':
t.multiplyNumber();
cout << "the total is: " << t.multiplyNumber() << endl;
break;
}
system("pause");
return 0 ;
}