User Entry Menu

Hey guys I was wondering if you can help me re-loop this menu. After the user selects one option, they should be able to select a different option. Currently it just skips over to the next option. Ex. from 1 to 2. Thanks.

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
int main () {
    cout << "Welcome to The SmartPhone Database." << "\n" << "Please select an option." << endl;
    cout << "\n" << "***Menu***" << "\n1. Add Item" << "\n2. Update Item" << "\n3. Display Item" << "\n4. Print Database" << "\n5. Exit Program\n" << endl;
    int entry;
    cin >> entry;
    while (entry != 5) {
    switch (entry) {
        case 1:
            int num;
            cout << "How many phones would you like to enter?" << endl;
            cin >> num;
            cout << "Enter product number, price, quantity on hand." << endl;
            addphone(productnum, price, quantityonhand, num);
        case 2:
            int numup;
            cout << "Enter the product number to update the price and quantitiy on hand." << endl;
            cin >> numup;
            updategame(productnum, price, quantityonhand, numup);
        case 3:
            int numdis;
            cout << "Enter the array value to display the items." << endl;
            cin >> numdis;
            displaygame(productnum, price, quantityonhand, numdis);
        case 4:
            int nump;
            cout << "How many lines of the database should be printed?" << endl;
            cin >> nump;
            printdata(productnum, price, quantityonhand, nump);
        case 5:
            return 0;
            }
        }
    return 0;
}
Try adding a break; at the end of each case, so it doesn't fall through to the next one.
Topic archived. No new replies allowed.