// Calculator.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include #include #include #include using namespace std; int main() { string ans; int option; int num1; int num2; cout << "would you like to use the calculator" << endl; cin >> ans; while (ans == "yes"||ans=="Yes") { cout << "option 1: addition" << endl; cout << "option 2: subtraction" << endl; cout << "option 3: division" << endl; cout << "option 4: multiplication" << endl; cin >> option; if (option == 1) { cout << "enter the first number: "; cin >> num1; cout << endl << "enter the second number: "; cin >> num2; cout << num1 << "+" << num2 << "=" << num1 + num2 << endl; cout << "would you like to continue using the calculator" << endl; cin >> ans; } else if (option == 2) { cout << "enter the first number: "; cin >> num1; cout << endl << "enter the second number: "; cin >> num2; cout << num1 << "-" << num2 << "=" << num1 - num2<> ans; } else if (option == 3) { cout << "enter the first number: "; cin >> num1; cout << endl << "enter the second number: "; cin >> num2; cout << num1 << "/" << num2 << "=" << num1 / num2<> ans; } else if (option == 4) { cout << "enter the first number: "; cin >> num1; cout << endl << "enter the second number: "; cin >> num2; cout << num1 << "*" << num2 << "=" << num1 * num2<> ans; } } }