Need help with menu/nested loop/switch?

For class we are supposed to make a Menu using a while loop and a switch statement. I have done the given code, but the output keeps giving me an extra menuT. How do I fix this and make it look like the expected output?

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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  #include <iostream>
using namespace std;

int main()
{
    string menuT="\n==== Menu Top ====\nA\tGoTo Menu A\nB\tGoTo Menu B\nE\tExit: ";
    string menuA="\n\t==== Menu A ====\n\tA\tDo Action A\n\tB\tDo Action B\n\tE\tExit: ";
    string menuB="\n\t==== Menu B ====\n\tA\tDo Action A\n\tB\tDo Action B\n\tE\tExit: ";
    string mexit="Exit Menu";
    string badi ="Bad Input";
    string dida ="\tDid A";
    string didb ="\tDid B";

    char c;
    while(c == 'a' || 'b' || 'e')
    {
        cout << menuT;
        cin >> c;

        switch (c)
        {
            case 'a':
                    cout << menuA;
                    cin >> c;
                        if (c == 'a')
                            cout << dida << menuA;
                        else if (c == 'b')
                            cout << didb << menuA;
                        else if (c == 'e')
                            cout << mexit << menuT;
                        else
                            cout << badi;
                        break;
            case 'b':
                    cout << menuB;
                    cin >> c;
                        if (c == 'b')
                            cout << didb << menuB;
                        else if (c == 'a')
                            cout << dida << menuB;
                        else if (c == 'e')
                            cout << mexit << menuT;
                        else
                            cout << badi;
                    break;
            default :
                cout << badi;

                }
    }
    return 0;


Here is the expected output:
==== Menu Top ====
A       GoTo Menu A
B       GoTo Menu B
E       Exit: 2
Bad Input

==== Menu Top ====
A       GoTo Menu A
B       GoTo Menu B
E       Exit: a
        ==== Menu A ====
        A       Do Action A
        B       Do Action B
        E       Exit: 2
        Bad Input

        ==== Menu A ====
        A       Do Action A
        B       Do Action B
        E       Exit: e
        Exit Menu

==== Menu Top ====
A       GoTo Menu A
B       GoTo Menu B
E       Exit: b

        ==== Menu B ====
        A       Do Action A
        B       Do Action B
        E       Exit: 2
        Bad Input

        ==== Menu B ====
        A       Do Action A
        B       Do Action B
        E       Exit: a
        Did A

        ==== Menu B ====
        A       Do Action A
        B       Do Action B
        E       Exit: b
        Did B

        ==== Menu B ====
        A       Do Action A
        B       Do Action B
        E       Exit: e
        Exit Menu

==== Menu Top ====
A       GoTo Menu A
B       GoTo Menu B
E       Exit: e
Exit Menu
Topic archived. No new replies allowed.