I am at work and did this program on notepad and not sure if this is correct or not. Can someone that has the visual studio compiler test this and let me know if it works. If it does no could you offer any minor feedback on the location of the errors since I am not able to debug it.
//Programmed by: JIm Johnson
//Date: 3-23-2009
//Assignment: In class assignment
class Arithmetic
{
public:
int Add(int num1, int num2);
int Subtract(int num1, int num2);
int Multiply(int num1, int num2);
private:
int addedTota, subtractedTotal, multipliedTotal;
};
//Adding the two numbers together
int Add(int num1, int num2)
{
int addedTotal;
addedTotal = num1 + num2;
cout << "The two numbers added together are: ";
cin >> addedTotal;
return addedTotal;
}
//Subtracting the two numbers together
int Subtract(int num1, int num2)
{
int subtractedTotal;
subtractedTotal = num1 - num2;
cout << "Subtracting the first and second number give a difference of: ";
cin >> subtractedTotal;
return subtractedTotal;
}
//Multiplying the two numbers together
int Multiply(int num1, int num2)
{
int multipliedTotal;
multipliedTotal = num1 * num2;
cout << "Numbers 1 and 2 multiplied together give a product of: ";
cin >> multipliedTotal;
return multipliedTotal;
}
int main()
{
cout << "Enter the first number: ";
cin >> num1;
cout << "Enter the second number: ";
cin >> num2;
Add(num1, num2);
Subtract(num1, num2);
Multiply(num1, num2);
}