Fast Food Ordering System

Creating a Fast Food Ordering System using C++ (Source Code)

Creating a Fast Food Ordering System using C++ (Source Code)

Hello, coders. Welcome to the codewithrandom blog. In this article, we will learn how to create a Fast Food Ordering System using C++ With Source Code.

What does a fast food ordering system include?

A fast food ordering system in C++ would consist of an interface along with the functionality for the implementation of a program that allows users to place orders for food items at a fast food restaurant. The program presents a food menu and allows users to select what they wish to eat. The user inputs their name and chooses what sort of food they want from the menu. The program asks the user to pick from the options available for that category of food, then enter the quantity of the food. The program then computes the order’s total cost and shows it to the user, along with an expected delivery time.

This project is built on the core principle of ordering fast food with the choice of quantity according to the customer and generating the total cost of the food. This system does not contain a login system structure. At that moment, the client can make a request by selecting an item from the menu and calculating the amount.

Creating Advanced Calculator using C++ (Source Code)

The objective of this project:

The project has basic functionality that allows you to order meals. This project was created to assist and speed up the fast food ordering service and order processing. The customer must pick one of the options from the main menu. Then he or she must select its kind and then enter the quantity they would like to purchase. Following that, the framework displays the client’s entire bill.

Overview of the UI:

———-Carl’s Jr. Fast Food———–
Please Enter Your Name: “
What would you like to order?
——–Menu——–
1) Pizzas
2) Burgers
3) Sandwich
4) Rolls
5) Biryani
Please Enter your Choice:
Upon entering the choice from the given 5 food options, we will get further more options of different kinds of that particular food. We will then make selection and add quantity we want. The system will generate the bill.

Food Ordering System Source code:

You can directly use this code by copying it in your IDE to understand the working and then can create the project.

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
    char name[30], pizza1[]="Chicken Fazita" ,pizza2[]="Chicken Bar BQ" ,pizza3[]="Peri Peri" ,pizza4[]="Creamy Max", roll1[]="Chicken Chatni Roll", roll2[]="Chicken Mayo Roll", roll3[]="Veg Roll With Fries",bur1[]="Zinger Burger",bur2[]="Chicken Burger",bur3[]="Beef Burger";
    char sand1[]="Club Sandwich", sand2[]="Chicken Crispy Sandwich", sand3[]="Extream Veg Sandwich";
    char bir1[]="Chicken Biryani", bir2[]="Prawn Biryani", bir3[]="Beef Biryani",gotostart ;
    int choice=0,pchoice,pchoice1, quantity;// time=40;
    beginning:
    system("CLS");
    cout<<"\t\t\t----------Carl's Jr. Fast Food-----------\n\n";
    cout<<"Please Enter Your Name: ";
    cin.getline(name, 20);
    cout<<"Hello "<<name<<"\n\nWhat would you like to order?\n\n";

    cout<<"\t\t\t\t--------Menu--------\n\n";

    cout<<"1) Pizzas\n";
    cout<<"2) Burgers\n";
    cout<<"3) Sandwich\n";
    cout<<"4) Rolls\n";
    cout<<"5) Biryani\n\n";
    cout<<"\nPlease Enter your Choice: ";
    cin>>choice;

    if(choice==1)
     {
        cout<<"\n1) "<<pizza1<<"\n";
        cout<<"2) "<<pizza2<<"\n";
        cout<<"3) "<<pizza3<<"\n";
        cout<<"4) "<<pizza4<<"\n";
        cout<<"\nPlease Enter which Flavour would you like to have?:";
        cin>>pchoice;
        if(pchoice>=1 && pchoice<=5)
        {
            cout<<"\n1) Small Rs.250\n"<<"2) Regular Rs.500\n"<<"3) Large Rs.900\n";
            cout<<"\nChoose Size Please:";
            cin>>pchoice1;
            if(pchoice1>=1 && pchoice1<=3)
            cout<<"\nPlease Enter Quantity: ";
            cin>>quantity;
            switch(pchoice1)
            {
            case 1: choice = 250*quantity;
            break;

            case 2: choice = 500*quantity;
            break;

            case 3: choice = 900*quantity;
            break;


                  }
            system("CLS");
            switch (pchoice1)
            {
             case 1:
             cout<<"\t\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<pizza1;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\n\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 2:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<"  "<<pizza2;
             cout<<"\nYour Total Bill is "<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 3:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<pizza3;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 4:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<pizza4;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;

            }
            cout<<"Would you like to order anything else? Y / N:";
            cin>>gotostart;
            if(gotostart=='Y' || gotostart=='y')
            {
              goto beginning;
              //return 0;
            }



        }

     }


     else if(choice==2)
     {
        cout<<"\n1 "<<bur1<<" Rs.180"<<"\n";
        cout<<"2 "<<bur2<<" Rs.150"<<"\n";
        cout<<"3 "<<bur3<<" Rs.160"<<"\n";
        //cout<<"4 "<<pizza4<<"\n";
        cout<<"\nPlease Enter which Burger you would like to have?: ";
        cin>>pchoice1;
        if(pchoice1>=1 && pchoice1<=3)
        {
            cout<<"\nPlease Enter Quantity: ";
            cin>>quantity;
            switch(pchoice1)
            {
            case 1: choice = 180*quantity;
            break;

            case 2: choice = 150*quantity;
            break;

            case 3: choice = 160*quantity;
            break;

            }
            system("CLS");
            switch (pchoice1)
            {
             case 1:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<bur1;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food \n";
             break;
             case 2:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<"  "<<bur2;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Pizza\n";
             break;
             case 3:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<bur3;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;


            }
            cout<<"\nWould you like to order anything else? Y / N:";
            cin>>gotostart;
            if(gotostart=='Y' || gotostart=='y')
            {
              goto beginning;
              //return 0;
            }

 }
}
    else if(choice==3)
     {
        cout<<"\n1  "<<sand1<<" Rs.240"<<"\n";
        cout<<"2  "<<sand2<<" Rs.160"<<"\n";
        cout<<"3  "<<sand3<<" Rs.100"<<"\n";
        //cout<<"4 "<<pizza4<<"\n";
        cout<<"\nPlease Enter which Sandwich you would like to have?:";
        cin>>pchoice1;
        if(pchoice1>=1 && pchoice1<=3)
        {
            cout<<"\nPlease Enter Quantity: ";
            cin>>quantity;
            switch(pchoice1)
            {
            case 1: choice = 240*quantity;
            break;

            case 2: choice = 160*quantity;
            break;

            case 3: choice = 100*quantity;
            break;

            }
            system("CLS");
            switch (pchoice1)
            {
             case 1:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<sand1;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 2:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<"  "<<sand2;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 3:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<sand2;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;


            }
            cout<<"Would you like to order anything else? Y / N:";
            cin>>gotostart;
            if(gotostart=='Y' || gotostart=='y')
            {
              goto beginning;
              //return 0;
            }
            }
            }


     else if(choice==4)
     {
        cout<<"\n1 "<<roll1<<" Rs.150"<<"\n";
        cout<<"2 "<<roll2<<" Rs.100"<<"\n";
        cout<<"3 "<<roll3<<" Rs.120"<<"\n";
        //cout<<"4 "<<pizza4<<"\n";
        cout<<"\nPlease Enter which you would like to have?: ";
        cin>>pchoice1;
        if(pchoice1>=1 && pchoice1<=3)
        {
            cout<<"\nHow Much Rolls Do you want: ";
            cin>>quantity;
            switch(pchoice1)
            {
            case 1: choice = 150*quantity;
            break;

            case 2: choice = 100*quantity;
            break;

            case 3: choice = 120*quantity;
            break;

            }
            system("CLS");
            switch (pchoice1)
            {
             case 1:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<roll1;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 2:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<"  "<<roll2;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 3:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<roll3;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;


            }

 }
}
    else if(choice==5)
     {
        cout<<"\n1 "<<bir1<<" Rs.160"<<"\n";
        cout<<"2 "<<bir2<<" Rs.220"<<"\n";
        cout<<"3 "<<bir3<<" Rs.140"<<"\n";
        //cout<<"4 "<<pizza4<<"\n";
        cout<<"\nPlease Enter which Biryani you would like to have?:";
        cin>>pchoice1;
        if(pchoice1>=1 && pchoice1<=3)
        {
            cout<<"\nPlease Enter Quantity: ";
            cin>>quantity;
            switch(pchoice1)
            {
            case 1: choice = 160*quantity;
            break;

            case 2: choice = 220*quantity;
            break;

            case 3: choice = 140*quantity;
            break;

            }
            system("CLS");
            switch (pchoice1)
            {
             case 1:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<bir1;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food \n";
             break;
             case 2:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<"  "<<bir2;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;
             case 3:
             cout<<"\t\t--------Your Order---------\n";
             cout<<""<<quantity<<" "<<bir3;
             cout<<"\nYour Total Bill is"<<choice<<"\nYour Order Will be delivered in 40 Minutes";
             cout<<"\nThank you For Ordering From Carl's Jr. Fast Food\n";
             break;


            }
            cout<<"Would you like to order anything else? Y / N:";
            cin>>gotostart;
            if(gotostart=='Y' || gotostart=='y')
            {
              goto beginning;
              //return 0;
            }
            }
            }

            else
            {
                system("CLS");
                cout<<"Please Select Right Option: \n";
                cout<<"Would You like to Start the program again? Y / N: " ;
                cin>>gotostart;

                if(gotostart=='Y' || gotostart=='y')
                {
                  goto beginning;
              //return 0;
            }
            }

     getch();
}

Now let us understand the code:-

  • After writing the header of the code with the required libraries – iostream and conio.h, which provide input and output functionality and console input/output functionality, respectively.
  • Then we will define the main() function. We will declare variables, character arrays to store the names of food items, an integer variable to store the user’s choice, and a character variable to store the user’s response to whether they want to order more items.
  • system(“cls”); – Used to clear the screen
  • The console after clearing the screen displays a welcome message and asks the user to enter their name.
  • Then the program displays the main menu and asks the user to select an item from the menu. 5 options are available to choose from in this project.
  • After entering the choice, we will write if-else if control statements to see what the user has selected from the menu. If the user chooses the “Pizzas” option, the program displays a range of pizza flavors and asks the user to choose one. After selecting a flavor, the program asks the user to choose a quantity and total amount is computed and displayed along with an expected delivery time.
  • Then we will use switch-case statements to display the user’s order and cost, based on the user’s selected flavor and quantity. The program then asks the user to order more items, and if the user responds with “Y” or “y”, the program jumps back to the beginning of the main() function to allow the user to order more items. If the user responds with “N” or “n”, the program ends.
  • The program at the end of ordering displays a thankyou statement – “Thank you For Ordering From Carl’s Jr. Fast Food”.
  • This sums up our project of Fast Food Ordering System using C++.

Creating an Employee Database Management project using C++

Output Of Food Ordering System:-

Here is an example to show how this project works

Entered choice – 2) Burgers

Fast Food Ordering System using C++

Enter the choice of flavor you would like to order and the required quantity.

Fast Food Ordering System using C++

Your order is displayed with the Total bill and expected delivery time.

Fast Food Ordering System using C++

Conclusion

Overall, this program offers consumers a straightforward and engaging way to purchase food from a fast food place.

Lets make an Advanced Calculator Program in C++ (Source Code)

We have reached the end of this article and have many more projects in C++ coming so stay tuned. We have started with awesome and fun projects for you all to understand C++. Learning C++ by creating fun projects makes learning easy and interesting.

If you enjoyed the article and learned something new today, let us know in the comments.

Thank you.

Happy Reading! 🙂



Leave a Reply