switch within switch HELP :(

Hi i have a problem when i am using switch within switch can u help me please?? :) so heres my 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <time.h>
#include <stdlib.h>
#include<stdio.h>

#include <time.h>
#include <ctype.h>
using namespace std;
double read_double( const char * msg_prompt ){
        char buf[ 12 ] = {'\0'};
        char * end = NULL;
        double result = 0;

        for(;;){
                printf( msg_prompt );
                fgets( buf, sizeof(buf), stdin );
                result = strtod( buf, &end );
                if( *end != 0 && !isspace(*end) ){
                        puts( "Non-numeric input is not acceptable! Try again." );
                }else break;
        }
        return result;
        
}
main()
{
      int select, input,num;
     string Password, Username;
     char choice[4];
  

float x=0,total=0,cash=0,sukli=0,bilang,price,Qty;
struct tm *t;
time_t rawtime;
rawtime =time(NULL);
t=localtime(&rawtime);
     
     cout<<"    ***********************************************************************\n";
     cout<<"    **                                                                   **\n";
     cout<<"    **                                                                   **\n";
     cout<<"    **   **    *   **   *****   **        *******     **   **    *****   **\n";
     cout<<"    **    **  * * **    **      **        *     *    ** * * **   **      **\n";
     cout<<"    **      **   **     *****   *******   *******   **   *   **  *****   **\n";
     cout<<"    **                                                                   **\n";
     cout<<"    **                      Turo Turo Restaurant                         **\n";
     cout<<"    **                                                                   **\n";             
     cout<<"    ***********************************************************************\n";
     cout<<"\n";
     
     cout<<"Username: ";
     cin>>Username;
     cout<<"\n";
     cout<<"Password: ";
   
    
  string password = "";
char c = ' ';

while(c != '\r') //Loop until 'Enter' is pressed
         {
         c = getch();
         if(c == '0')
            {
            switch(getch())
               {
               default:
                  break;            
               };
            }
         else if(c == '\b')   //If the 'Backspace' key is pressed
            {
            if(password.size() != 0)  //If the password string contains data, erase last character
               {
               cout << "\b \b";
               password.erase(password.size() - 1, 1);
               }
            continue;
            }
         else if(c <= '9' && c >= '0' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')  //If user enters 1-9, a-z, or A-Z, add it to the password and display an asterisk
            {
            password += c;
            cout << "*";
            }
         else
            continue;
         }

 
         cout<<"\n\n\n\n\n\n\t\t\tLoading Please Wait..................."<<endl;         
         Sleep(1500);
 

    
    
do
{

system("cls");

first:

printf("\tTuro Turo Specialty\n\n\n");

printf("Date: %d/%d/%d ",t->tm_mon+1, t->tm_mday,t->tm_year + 1900);
printf("\t\t Time: %d:%d:%d\n\n\n", t->tm_hour,t->tm_min,t->tm_sec);

printf("[1]Rice\n");
printf("[2]Ulam\n");
printf("[3]Drinks\n");
printf("[4]Desert\n");
printf("[0]Total or Exit\n\n");


do
{ 
printf("Please choose: ");
scanf("%d",&select);

switch(select)
{
case 1:
cout<<"\n                 [Qty]                  [Price]";
cout<<"\n [a1]Unli Rice     30                     50.00              \n";
cout<<"\n [a2]Java Rice     30                     15.00              \n";
cout<<"\n [a3]Sinangag      30                     15.00              \n";
cout<<"\n [a4]Plain Rice    30                     10.00              \n"<<endl;
break;

scanf( "%s", choice );
if( choice[0]=='1' ){
   switch( choice[1] ){
      case '5':
           cout<<"how many: ";
   
   break;
}
}

scanf( "%s", choice );
if( choice[0]=='1' ){
   switch( choice[2] ){
      case 'a':
           cout<<"how many: ";
   
   break;
}
}



case 2:
cout<<"\n                               [Qty]                  [Price]"<<endl;
cout<<"\n [b1]Ginataang Talbos           30                     25.00              \n";
cout<<"\n [b2]Nilagang Nuggets           30                     30.00              \n";
cout<<"\n [b3]Sinigang na Kwek-Kwek      30                     30.00              \n";
cout<<"\n [b4]Sinigang na Kwek-Kwek      30                     30.00              \n";
cout<<"\n [b5]Lechon Siomai              30                     30.00              \n";
cout<<"\n [b6]Adobong Fishball           30                     30.00              \n"<<endl;

printf("How Many: ");
scanf("%f",&bilang);
price = bilang * 10;
total = total + price;
break;

case 3:
cout<<"\n                               [Qty]                  [Price]";
cout<<"\n [c1]Tubig                      30                     5.00              \n";
cout<<"\n [c2]Ice tea                    30                     15.00             \n";
cout<<"\n [c3]Chocolate                  30                     15.00              \n";
cout<<"\n [c4]Kape                       30                     10.00              \n";
cout<<"\n [c5]Coke 1.5                   30                     40.00              \n";
cout<<"\n [c6]Coke in can                30                     15.00              \n";
cout<<"\n [c7]Sprite 1.5                 30                     40.00              \n";
cout<<"\n [c8]Sprite in can              30                     15.00              \n"<<endl;
cout<<"\n [c9]Rc Malaki                  30                     20.00              \n";
cout<<"\n [c10]Rc Maliit                  30                     5.00              \n";
cout<<"\n [c11]Buko Shake                 30                     20.00              \n";


break;

case 4:
cout<<"\n                               [Qty]                  [Price]";
cout<<"\n [d1]French Fries               30                     5.00              \n";
cout<<"\n [d2]Ice Cream                  30                     15.00             \n";
cout<<"\n [d3]Fruit Combo                30                     15.00              \n";
cout<<"\n [d4]Halo-Halo                  30                     10.00              \n";
cout<<"\n [d5]Coke 1.5                   30                     40.00              \n";
cout<<"\n [d6]Coke in can                30                     15.00              \n";
cout<<"\n [d7]Sprite 1.5                 30                     40.00              \n";
cout<<"\n [d8]Sprite in can              30                     15.00              \n"<<endl;
cout<<"\n [d9]Rc Malaki                  30                     20.00              \n";
cout<<"\n [d10]Rc Maliit                  30                    5.00              \n";
cout<<"\n [d11]Buko Shake                 30                    20.00              \n";

break;



case 0:
goto second; 
default:
printf("Invalid Order\n");
break;
}
}while(select!=0);
second:
if(select == 0 && total == 0)
{
printf("Order food");
getch();
return 0;
}
else

printf("the total amount you order is %.2f\n",total);
printf("Enter amount of your cash: ");
scanf("%f",&cash);


while(cash<total)
{
printf("Kulang po\n");
printf("Enter amount of your cash: ");
scanf("%f",&cash);
}

sukli = cash - total;
printf("Ang iyong sukli ay %.2f\n",sukli);
printf("Salamat Balik ulit kayo");

getch();
select =1;
x=0,total=0,cash=0,sukli=0;

}while(select!=0);



}







line 130-152 will never be executed because of the break statement in line 129
what should i do ? im sorry im just a newbie and depending on my notes
Remove the break statement in line 129 and add one in line 152
and then?? what should i do next?
Topic archived. No new replies allowed.