473,419 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

when i compile i keep on getting error expected unqualified id

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <malloc.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6. #include <ctype.h>
  7. #define delivery =5
  8.  
  9. using namespace std;
  10. int choice1,choice2,n,price,pay,i,pm;
  11. char username[20],set;
  12. void loadingbar();
  13. void autoCreateMenu();
  14. void foodList();
  15. void bill();
  16.  
  17. do
  18.     {
  19.         system("cls");
  20.         printf("\n\t\t\t\t\t============================================\n\t\t\t\t\t\t\tL O G I N\n\t\t\t\t\t============================================\n\n\t\t\t\t\t\t\t1. User\n\n\t\t\t\t\t\t\t2. Admin\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\tEnter choice: ");
  21.         scanf("%d",&choice1);
  22.  
  23.         switch(choice1)
  24.         {
  25.             case 2: system("cls");
  26.  
  27.                     do{
  28.                     printf("\n\t\t\t\t\t============================================\n\t\t\t\t\t\t    A D M I N   P A N E L\n\t\t\t\t\t============================================\n\n\t\t\t\t\t\t1. Edit Menu\n\n\t\t\t\t\t\t2. Orders\n\n\t\t\t\t\t\t3. Back\n\n\n\t\t\t\t\t\tEnter choice: ");
  29.                     scanf("%d",&choice2);
  30.  
  31.                     switch(choice2)
  32.                     {
  33.                             case 1:
  34.                                 do
  35.                                 {
  36.                                     system("cls");
  37.                                     printf("\n\t\t\t\t\t============================================\n\t\t\t\t\t\t\tE D I T   M E N U\n\t\t\t\t\t============================================\n\n\t\t\t\t\t\t1. Add Items\n\n\t\t\t\t\t\t2. Edit Item\n\n\t\t\t\t\t\t3. View Menu\n\n\t\t\t\t\t\t4. Back\n\n\t\t\t\t\t\tEnter choice: ");
  38.                                     scanf("%d", &choice2);
  39.  
  40.                                     switch(choice2)
  41.                                     {
  42.                                         case 1:
  43.                                             system("cls");
  44.                                             createMenuItem();
  45.                                             getch();
  46.                                             break;
  47.  
  48.                                         case 2:
  49.                                             editItem();
  50.                                             break;
  51.  
  52.                                         case 3:
  53.                                             system("cls");
  54.                                             displayMenu();
  55.                                             printf("\n\n\t\t\t\t\t  Press any button to return to previous screen");
  56.                                             getch();
  57.                                             break;
  58.                                     }
  59.                                 }while(choice2!=4);
  60.                                 system("cls");
  61.                                 break;
  62.  
  63.  
  64.                             case 2:
  65.  
  66.                                 do
  67.                                 {
  68.                                     system("cls");
  69.                                     printf("\n\t\t\t\t\t============================================\n\t\t\t\t\t\t\tO R D E R S\n\t\t\t\t\t============================================\n\n\t\t\t\t\t\t1. Serve order\n\n\t\t\t\t\t\t2. View Orders\n\n\t\t\t\t\t\t3. Back\n\n\t\t\t\t\t\tEnter choice: ");
  70.                                     scanf("%d", &choice2);
  71.  
  72.                                     switch(choice2)
  73.                                     {
  74.                                         case 1:
  75.                                             system("cls");
  76.                                             dequeueOrder();
  77.                                             getch();
  78.                                             break;
  79.  
  80.                                         case 2:
  81.                                             system("cls");
  82.                                             displayOrder();
  83.                                             getch();
  84.                                             break;
  85.                                     }
  86.                                 }while(choice2!=3);
  87.                                 break;
  88.                         }
  89.                     }while(choice2!=3);
  90.                     break;
  91.  
  92.  
  93.             case 1: system("cls");
  94.                     printf("\n\n\n\n\n\n\t\t\t\t\t\tEnter username: ");
  95.                     ccolor(10);
  96.                     fflush(stdin);
  97.                     gets(username);
  98.                     ccolor(15);
  99.  
  100.                     do
  101.                     {
  102.                         system("cls");
  103.                         printf("\n\t\t\t\t\t============================================\n\t\t\t\t\t\tW E L C O M E , ");
  104.                         stringify(username);
  105.                         printf("\n\t\t\t\t\t============================================\n\n\t\t\t\t\t\t1. Order\n\n\t\t\t\t\t\t2. View Cart\n\n\t\t\t\t\t\t3. Proceed to Checkout\n\n\t\t\t\t\t\t0. <- Back\n\n\n\t\t\t\t\t\tEnter choice:");
  106.                         scanf("%d",&choice2);
  107.  
  108.                         switch(choice2)
  109.                         {
  110.                             case 1: pushFoodItem(username);
  111.                                     foodList();
  112.                                     break;
  113.  
  114.                             case 2: displayCart(username);
  115.                                     printf("\n\n\t\t\t\t\t  Press any button to return to previous screen");
  116.                                     getch();
  117.                                     break;
  118.  
  119.                             case 3: enqueueOrder(username);
  120.                                     displayCart(username);
  121.                                     bill();
  122.                                     ccolor(47);
  123.                                     printf("\n\n\t\t\t\t\t\t  Order placed successfully ");
  124.                                     ccolor(15);
  125.                                     printf("\n\n\t\t\t\t\t  Press any button to return to main screen");
  126.                                     getch();
  127.                                     Sleep(50);
  128.  
  129.                                     break;
  130.                         }
  131.                     }while (choice2!=0 && choice2!=3);
  132.  
  133.                     break;
  134.         }
  135.     }while(choice1!=4);
  136. }
  137.  
  138. void foodList()
  139. {
  140.     cout<<"*************************************************MENU*********************************************************"<<endl;
  141.     cout<<"*                                                                                                              *"<<endl;
  142.     cout<<"*               SET A                                SET B                               SET C                 *"<<endl;
  143.     cout<<"*       Grilled Chicken Chop                   Chicken Curry with Rice              Sweet and Sour Chicken           *"<<endl;
  144.     cout<<"*               Prawn                          Sweet and sour prawn               Prawn with vegetables        *"<<endl;
  145.     cout<<"*            Cheese Cake                            Fruit Cake                          Mango Cake             *"<<endl;
  146.     cout<<"*             Sprite                               Apple Juice                         Mango Juice             *"<<endl;
  147.     cout<<"*              RM 35                                 RM 40                                RM 45                *"<<endl;
  148.     cout<<"*                                                                                                              *"<<endl;
  149.     cout<<"*                                SET D                                 SET E                                   *"<<endl;
  150.     cout<<"*                            Fish and chips                      Grilled Lamb Chop                             *"<<endl;
  151.     cout<<"*                              Ice-cream                            Custard Pies                               *"<<endl;
  152.     cout<<"*                              Hot Choco                           Iced Green Tea                              *"<<endl;
  153.     cout<<"*                                RM 30                                 RM 30                                   *"<<endl;
  154.     cout<<"****************************************************************************************************************"<<endl;
  155. }
  156.  
  157. void bill();
  158.  
  159. {
  160.     if(set=='a'||set=='A')
  161.         price=35
  162.         cout<<"Total= RM 35";
  163.     else if(set=='b'||set=='B')
  164.         cout<<"Total= RM 40";
  165.     else if(set=='c'||set=='C')
  166.         cout<<"Total= RM 45";
  167.     else if(set=='d'||set=='D')
  168.         cout<<"Total= RM 30";
  169.     else if(set=='e'||set=='E')
  170.         cout<<"Total= RM 30";
  171.     else
  172.         cout<<"SORRY! You enter the wrong item. Please try again.";
  173.         cin>>set;
  174.  
  175.     cout<<"Quantity: "<<i<<endl;
  176.  
  177.     cout<<"Select the payment method: "<<endl;
  178.     cout<<" a. Membership"<<endl;
  179.     cout<<" b. Cash"<<endl;
  180.     cin>>pm;
  181.     if(pm=='a')
  182.     {
  183.         cout<<"Account Balance: RM 100"<<endl;
  184.         pay=balance-(5+(i*price));
  185.     }
  186. }
  187.  
  188.  
  189.  
  190.  
  191.  
  192. /*//******************************************************************************************************************************************
  193. //                                      wait function defenation which use for exit function
  194. //*******************************************************************************************************************************************
  195. void wait ( int seconds )
  196. //this function contains void type & returns nothing
  197.  
  198.  
  199. {
  200.  clock_t waitend;
  201.  waitend = clock () + seconds * CLOCKS_PER_SEC ;
  202.  while (clock() < waitend) {}
  203. }*/
Jun 21 '21 #1
1 3312
dev7060
636 Expert 512MB
You can't have code outside of functions except for global vars, function declarations, macros, etc.
Jun 22 '21 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: madhu8065 | last post by:
Dim ipadd 'As String; ipadd =HttpContext.Current.Request.ServerVariables; if (string.IsNullOrEmpty(ipadd) || ipadd.Equals("unknown", StringComparison.OrdinalIgnoreCase)) { ipadd =...
12
by: sam23 | last post by:
Hi all, im new to this programming language and i tried to use my Xcode to build and run this code but i got a error :(, and another error is i need a help guys #include <GLUT/glut.h>...
1
by: SilentNinja | last post by:
Okay so I'm in a intro to programming class and for an assignment we're supposed to develop a program that gives the ingredients for fruit punch and convert the normal service size to a service size...
1
by: britishfood | last post by:
File could not be uploaded.A generic error occurred in GDI+. > Process Begun...Calculated dimensions...Created graphic based on new bitmap...Set properties on new graphic based on resized...
2
by: atiqah | last post by:
#include <iostream> using namespace std; class DB; class DM{ public: DM(){} DM (float meter, float cm); friend int func(DM,DB); };
17
by: AffinityCreate | last post by:
Hi, Not quite sure if someone will be able to help me but.......... I am currently trying to build a menu layout for a 20x4 LCD. I originally had the LCD working with the keypad to have a...
3
by: AffinityCreate | last post by:
Hi I am trying to add the DS1307 to my project via I2C using both a keypad and LCD. So far I have been able to get my project working with a passcode entry, led, keypad input and LCD display. I as...
2
by: Easay9 | last post by:
I have an assignment that is giving me this annoying error I am wondering if anyone might know what is wrong I am by no means an expert and will take all feedback.
2
by: vikram77 | last post by:
this is my code: I am getting an error:expected unqualified-id before string constant #include<iostream> #include<string> "version":1 "name":"Example project" "build_commands": {...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.