Calculator Menu

I made a calculator with the following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  #include <cstdlib>
#include <iostream>

using namespace std;

int addition(int num1, int num2)
{
    return num1 + num2;
}
int subtraction(int num1, int num2)
{
    return num1 - num2;
}
int multiplication(int num1, int num2)
{
    return num1 * num2;
}
int division(int num1, int num2)
{
    return num1 / num2;
}

int main()
{
    int number1;
    int number2;
    //Addition
    cout << "You are adding. Enter the first number you would like to add. \n Number 1: ";
    cin >>number1;
    cout << " Enter the second number. \n Number 2: ";
    cin >> number2;
    cout << " The answer is: " << addition(number1, number2) << endl;
    
    //Subtraction
    cout << "You are subtracting. Enter the first number you would like to subtract. \n Number 1: ";
    cin >> number1;
    cout << "Enter the second number. \n Number 2: ";
    cin >> number2;
    cout << " The answer is: " <<subtraction(number1, number2) << endl;
    
    //Multiplication
    cout << "You are multiplying. Enter the first number you wish to multiply. \n Number 1: ";
    cin >> number1;
    cout <<" Enter the second number. \n Number 2: ";
    cin >> number2;
    cout << " The answer is: " << multiplication(number1, number2)  << endl;
    
    //Division
    cout << "You are dividing. Enter the first number you wish to divide. \n Number 1: ";
    cin >> number1;
    cout << " Enter the second number you wish to divide. \n Number 2: ";
    cin >> number2;
    cout << " The answer is: " << division(number1, number2) << endl;

    //End program
}


I want to implement a menu that would allow a user to input 'a' for addition, 's' for subtraction, 'm' for multiplication, and 'd' for division, and then press enter and the program will go to the corresponding section (addition, subtraction, multiplication, division). How would I add such a menu into this code?
Thanks in advance.
Topic archived. No new replies allowed.