#include
using namespace std;
int main()
{
long double NR1,NR2,NR3;
int OP1;
cout << "this is a basic calculator; \nenter a number, an operator (such as +,-,* or /)\nand then a second number, and the product will be calculated\n";
cout << "please enter the first number and hit enter\n";
cin>> NR1;
cin.ignore(); //get first number for eqaution
cout<< "now, enter an operator according to the following:\n";
cout<< "1 = + \n";
cout<< "2 = - \n";
cout<< "3 = * \n";
cout<< "4 = / \n";
cout<< "please enter the operator\n";
cin>> OP1;
cin.ignore(); //get operator for equation
cout<< "please enter the second number and hit enter:\n";
cin>> NR2;
cin.ignore(); //get second number for eqaution
/* after this, the program runs to the correct if statement
to execute the calculation and show the answer */
if ( OP1 == 1 ) {
NR3= NR1 + NR2; //use if OP1 is 1 (+)
}
else if ( OP1 == 2 ) {
NR3= NR1 - NR2; // use if OP1 is 2 (-)
}
else if ( OP1 == 3 ) { //use if OP1 is 3 (*)
NR3= NR1 * NR2;
}
else if ( OP1 == 4 ) { //use if OP1 is 4 (/)
NR3= NR1 / NR2;
}
cout<< "the product is:\n"<