0% found this document useful (0 votes)
18 views

C++ Shell

The document is a code snippet from an online C++ compiler (cpp.sh) that is taking an order for a burger shop. It displays a menu and asks the user to enter their order. It then checks if the entered order matches any menu items, and if not, it prompts the user to confirm their final order or re-enter it. The code is compiling with some warnings about multi-character constants for the Yes/No responses.

Uploaded by

pecanig955
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

C++ Shell

The document is a code snippet from an online C++ compiler (cpp.sh) that is taking an order for a burger shop. It displays a menu and asks the user to enter their order. It then checks if the entered order matches any menu items, and if not, it prompts the user to confirm their final order or re-enter it. The code is compiling with some warnings about multi-character constants for the Yes/No responses.

Uploaded by

pecanig955
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

12/31/23, 11:45 PM C++ Shell

C++ shell cpp.sh


cpp.sh
online C++ compiler
about cpp.sh

11 {
12 system("cls");
13 char choice;
14 string name;
15 int s, z;
16
17 cout << "Welcome to Burger Stop!" << endl<< endl;
18
19 cout << "MENU"<< endl<< endl;
20
21 cout <<item[0]<<"\n"<<"Price: P"<<a<<"\n"<<endl;
22 cout <<item[1]<<"\n"<<"Price: P"<<b<<"\n"<<endl;
23 cout <<item[2]<<"\n"<<"Price: P"<<c<<"\n"<<endl;
24 cout <<item[3]<<"\n"<<"Price: P"<<d<<"\n"<<endl;
25
26 cout << "Enter your order: ";
27 cin>>name;
28
29 for(int i = 0; i < 4; i++)
30 {
31 if (name != item[i])
32 {
33 cout << "Is this your final order? (Yes or No?)";
i h i
Link to this code: [copy]

compilation
main.cpp:36:18: warning: multi-character character constant [-Wmultichar]
if (choice == 'Yes' || choice == 'yes')
^
main.cpp:36:37: warning: multi-character character constant [-Wmultichar]
if (choice == 'Yes' || choice == 'yes')
^
main.cpp:38:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
break;
^
main.cpp:36:4: note: previous statement is here
if (choice == 'Yes' || choice == 'yes')
^
main.cpp:39:4: error: expected expression
else if (choice == 'No' || choice == 'no') // in my compiler theres an error of "multi-character constant"
^
main.cpp:36:34: warning: result of comparison of constant 7955827 with expression of type 'char' is always false [-Wtautological-constant-out-of-range
if (choice == 'Yes' || choice == 'yes')
~~~~~~ ^ ~~~~~
main.cpp:36:15: warning: result of comparison of constant 5858675 with expression of type 'char' is always false [-Wtautological-constant-out-of-range
if (choice == 'Yes' || choice == 'yes')
~~~~~~ ^ ~~~~~
5 warnings and 1 error generated.

C++ Shell 2.0 © cpp.sh 2014-2023 | buy me a coffe


old version still available here (for a limited time).

https://cpp.sh 1/1

You might also like