Help with Homework

Create a program has a class called calculator, which contains four functions:
▪ Addition
▪ Subtraction
▪ Multiplication
▪ Division
In the main() method ask the user to enter two float numbers.

How far have you got?
the output should look like:

Enter the First number:12
Enter the second numberz6
the result of Addition is 18
the result of Subtraction is 6
the result of Multiplication is 72
the result of Division is 2
Process returned 6 (6x6) execution time : 3-525 5
Press any key to continue.



include <iostream>
using namespace std;


/*Create a class called calculator which has two private data member nl and n:
and five public member functions:
Set, Additiun, Subtraction, Multiplication, and Division*/
int main()

float numl, num2;
cout<< "Enter the first number:";
cin>> numl;
cout<< "\nEnter the second number:":
cin>> num2;
cout << "\nthe result of Addition is " << -<<endl;
cout << "the result of Subtraction is " << -<<endl;
cout << "the result of Multiplication is " <<-<<endl;
cout << "the result of Division is " << -<<endl;
return 0;
The instructions begin:
Create a class called calculator


Do that.

I cannot stress how important it is to follow the instructions in your homework. If you don't do what the homework says to do, you'll do very badly.

Topic archived. No new replies allowed.