Question: I need help to convert this program and FUNCTIONS of C++ to Python #include #include using namespace std; int x, y, result; string op; int

I need help to convert this program and FUNCTIONS of C++ to Python

#include #include using namespace std;

int x, y, result; string op;

int Add(int x, int y) { result = x + y;

return result;

} int Division(int x, int y) { result = x / y;

return result;

} int Multiplication(int x, int y) { result = x * y;

return result;

} int Substraction(int x, int y) { result = x - y;

return result;

}

int main() {

cout << "Please make a selection 1. Addition 2. Division 3. Multiplication 4. Subtraction 0. to EXIT ->>"; cin >> op;

if (op == "1") { cout << "Please enter the first number "; cin >> x; cout << "Please enter the second number "; cin >> y; result = Add(x, y); cout << result; } else if (op == "2") { cout << "Please enter the first number "; cin >> x; cout << "Please enter the second number"; cin >> y; result = Division(x, y); cout << result; } else if (op == "3") { cout << "Please enter the first number "; cin >> x; cout << "Please enter the second number "; cin >> y; result = Multiplication(x, y); cout << result; } else if (op == "4") { cout << "Please enter the first number "; cin >> x; cout << "Please enter the second number "; cin >> y; result = Substraction(x, y); cout << result; } else if (op == "0") { cout << "GoodBye"; }

return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!