Bakery Management System using C++

Bakery Management System using C++ (With Source Code)

Bakery Management System using C++ (With Source Code)

Hello, coders. Welcome to the codewithrandom blog. In this article, we will learn how to create a Bakery Management System using C++ (With Source Code).

Bakery Management System using C++

A Bakery Management System is built on the idea of keeping track of orders and managing a specific bakery establishment.

We will be creating this project by dividing it into two sections:

  1. Bakery item ordering
  2. Admin panel.

In this system, a user can keep daily ordering records by utilizing this management system. When the user selects Bakery Order, the system presents a selection of available bakery goods and drinks, and the user must place an order with item quantity. Following that, he/she moves on to Order confirmation and Payment methods.

Airline Ticketing System using C++ (With Source Code)

This system accepts payments in two methods:

  1. cash and
  2. credit cards .

When using a credit card, the user must input the card number and pin number for transactions.

For the Admin panel:

An admin has the complete control over the system. Admin may check the day’s total cash and card transactions, add bakery items, remove items, list instant items, item counter, backup system, and preview instant orders. When adding bakery products, the user must provide the item’s name, quantity, serial number (without repeating), and price. For daily records, the system additionally shows the customer’s card information and transaction amount. All of the bakery orders for the day may be quickly seen using the Admin Panel’s Instant Order Preview Option.

Overview of the UI:

>> 1. Bakery Item List
>> 2. Admin Panel
>> 3. Exit

UI for the Bakery Item List:

You will be displayed with a list of bakery items

UI for the Admin panel:

>>>> Admin Panel <<<<
1. Total Cash Today
2. View Card Pay
3. Add Bakery Item
4. Delete Item
5. Instant Item List
6. Item Counter
7. Backup System
8. Instant Order Preview
0. Main Menu
Enter Your From 1-0:
The user will choose an option to perform the operation of their choice. User will then enter a values according to the prompts that will be displayed on the console to perform that operation.

Bakery Management System using C++ Source code:

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

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
#include<windows.h>
#include<time.h>


///Logic Functions

   /// Update & Insert Function
void insertfirst(int data, char foodname[25], int quantity, float price);
void insertmid(int pos, int data, char foodname[25], int quantity, float price);
void insertend(int data, char foodname[25], int quantity, float price);
void updatefood(int udata, int uquantity);

     /// Display Function
void foodlist();
void order_view(int order, int quantity, int or_no);
void main_menu();

    ///Delete & Count Function
void deletefood(int serial);
int countitem();




///extra design Function

void cls();
void echo(char print[]);
void br(int line);
void pre(int tab);
void span(int space);
void ccolor(int clr);
void pwellcome();
void loadingbar();
void middle1(void);
void middtab1(void);
void backuploader(void);


        ///START Structure Here

struct Node{

    char foodname[50];
    int quantity;
    float price;
    int data;
    struct Node *next;

};

   ///Global Type

typedef struct Node node ;

node *head, *list;

int main(){

    system("title Bakery House Management System");
    system("mode con: cols=88 lines=30");


    loadingbar(); cls();
    pwellcome();
    Sleep(300);
    cls();

    int c=0; int any;
    int cardno[100];
    float cardmoney[100];
    float totalmoney = 0;
    int total_order[100];
    int order_quantity[100];
    int order=0;
    int uquantity;
    int citem;

    head = NULL;
    insertfirst(5,"Birthday Cakes",23,120.23);
    insertend(6,"Pancakes    ",13,100.67);
    insertend(1,"Cookies",8,720.83);
    insertend(2,"Coffee  ",46,70.23);
    insertend(3,"Brownies   ",46,70.23);
    insertend(4,"Hot Pudding  ",34,60.23);
    insertend(7,"Chocolate Ice cream",7,520.29);
    insertend(8,"Grain Breads",121,35.13);
    insertend(9,"Cold drinks",73,20.13);



    mainmenu:
    br(1);

    main_menu();

    int main_menu_choice;

    br(1); pre(4); fflush(stdin); scanf("%d",&main_menu_choice);

    if((main_menu_choice >=1 && main_menu_choice <=3)){

        if(main_menu_choice == 1){

            foodlist:

            cls();
            printf("=> 0. Main Menu ");
            foodlist();


        }

        else if( main_menu_choice == 2){

            adminpanelchoice:

            int admin_panel_choice;

            cls(); middle1() ;   pre(4);  printf("1. Main Menu\n\n\t"); Sleep(300);
            printf("Please Enter Password or ( 1 to Back in Main Menu ) : ");


            fflush(stdin);  scanf("%d",&admin_panel_choice);

            if(admin_panel_choice==1234567){



                node *temp;

                temp = list;

                adminchoise:

                cls();  br(3); pre(4); echo(">>>> Admin Panel <<<<   \n\n");
                pre(4);
                printf(" 1. Total Cash Today \n\n");Sleep(250);pre(4);
                printf(" 2. View Card Pay \n\n");Sleep(250);pre(4);
                printf(" 3. Add Bakery Item \n\n");Sleep(250);pre(4);
                printf(" 4. Delete Item \n\n");Sleep(250);pre(4);
                printf(" 5. Instant Item List \n\n");Sleep(250);pre(4);
                printf(" 6. Item Counter \n\n");Sleep(250);pre(4);
                printf(" 7. Backup System\n\n");Sleep(250);pre(4);
                printf(" 8. Instant Order Preview\n\n");Sleep(250);pre(4);
                printf(" 0. Main Menu \n\n");
                printf("Enter Your From 1-0: ");
                Sleep(250);

                int adminchoise;



                fflush(stdin);   scanf("%d",&adminchoise);

                if(adminchoise==1){

                    cls();  middle1(); pre(4);   printf("Todays Total Cash : %0.2f  \n",totalmoney);

                    Sleep(2000);

                    goto adminchoise;
                }
                else if(adminchoise==2){

                    if(c!=0){

                        cls();  br(3); pre(4);

                        printf(" ____________________________\n");pre(4);
                        printf("|   Card NO.   |   Money $   |\n");pre(4);
                        printf("------------------------------\n");pre(4);

                        for(int z=1; z<=c;z++){

                            printf("|  %d  | %0.2f |\n",cardno[z],cardmoney[z]);pre(4);
                            printf("------------------------------\n");pre(4);
                            Sleep(150);

                        }
                        Sleep(1500);
                    }

                    if(c==0){

                        cls();  middle1(); pre(4);
                    printf("No Card History\n");}
                    Sleep(1500);
                    goto adminchoise;
                }

                else if(adminchoise==3){

                    foodadd:
                    cls();

                    char ffoodname[25];
                    int fquantity;
                    int fdata;
                    float fprice;
                    int fposi;


                    br(3);pre(4);      printf(" Enter Bakery Item Name :  ");

                    fflush(stdin);     scanf("%[^\n]s",ffoodname);
                    fquantity:
                    fflush(stdin);

                    br(2);pre(4);
                    printf(" Enter Item Quantity :  ");

                    scanf("%d",&fquantity); fflush(stdin);

                        foodserial:
                    br(2);pre(4);  printf(" Enter Item Serial :  ");
                      scanf("%d",&fdata);
                            node *exist;
                            exist = list;
                      while(exist->data!=fdata){
                            if(exist->next==NULL){
                                break;
                            }
                        exist=exist->next;
                      }
                      if(exist->data==fdata){
                       cls(); br(5);pre(3);  printf(" Bakery Item Serial Already Exist, Please Re-Enter  "); Sleep(2000);
                       goto foodserial;
                      }

                    fprice:
                      fflush(stdin);

                    br(2);pre(4);  printf(" Enter Item Price :  ");fflush(stdin);

                    scanf("%f",&fprice);



                    br(2);pre(4);  printf("Submitting your data");for(int cs=0;cs<4;cs++){printf(" .");Sleep(500);}


                    insertend(fdata,ffoodname,fquantity,fprice);

                    br(2);pre(4);      printf("Adding Item  Successfull.......\n");

                    Sleep(2000);

                    goto adminchoise;

                }
                else if(adminchoise==4){

                    cls();
                    middle1();pre(2);
                    printf("Enter Serial No of the Item To Delete : ");
                    fdelete:
                    int fdelete;
                    fflush(stdin); scanf("%d",&fdelete);
                    node *temp;
                    temp=list;
                    while(temp->data != fdelete){
                        temp = temp->next;
                    }
                    if(temp->data==fdelete){
                        deletefood(fdelete);
                    }
                    else{
                        br(2); pre(2); printf("Please Enter Correct Number :  "); Sleep(500);
                        goto fdelete;
                    }


                    goto adminchoise;
                }

                else if(adminchoise==5){

                    cls();    foodlist(); Sleep(1000);

                    br(2);pre(4);  printf("1. <-- back  \n\n");pre(5);



                    fflush(stdin);   scanf("%d",&any);

                    goto adminchoise;

                }

                else if(adminchoise==6){

                    citem = countitem();
                    cls();
                    for(int cs=1;cs<=citem;cs++){
                        middle1(); pre(4);
                        printf("Item Counting ");
                        printf(" %d ",cs);
                        Sleep(150);
                        cls();
                    }
                    cls();
                    middle1();pre(4);
                    printf("Total Item Item is --> %d  \n",citem); Sleep(2000);
                    goto adminchoise;

                }

                        ///Backup System
                else if(adminchoise==7){


                    char date[35]=__DATE__;

                    strcat(date,".txt");
                    FILE *fptr;
                    fptr=fopen(date,"w");
                    backuploader();
                    if(fptr==NULL){
                        br(3); pre(3); printf("Error!"); Sleep(500);
                        goto adminchoise;
                    }
                    fprintf(fptr,"Total Cash Today : %0.2f\n\n\n",totalmoney);
                    fprintf(fptr,"Card No ------- Money \n\n");
                    for(int l=1; l<=c;l++){
                        fprintf(fptr,"%d ------- %0.2f \n",cardno[l],cardmoney[l]);
                    }
                    br(2);pre(4); printf("Backup Successfull..."); Sleep(1500);



                    fclose(fptr);
                    goto adminchoise;
                }
                else if(adminchoise==8){

                    cls();br(2);pre(2);
                    ccolor(26);
                    printf("\n\t\t"); ccolor(240);
                    printf("______________________________________________________ "); ccolor(26);
                    printf("\n\t\t");  ccolor(240);
                    printf("|  Order No.  |   Item Name   |  Quantity |  In Stock |"); ccolor(26);
                    printf("\n\t\t");  ccolor(240);
                    printf("------------------------------------------------------"); ccolor(26);
                    for(int o=1;o<=order;o++){
                        order_view(total_order[o],order_quantity[o],o);
                    }

                    br(2);pre(4);  printf("1. <-- back  \n\n");pre(5);

                    fflush(stdin);   scanf("%d",&any);

                    goto adminchoise;



                }
                else if(adminchoise==0){

                    goto mainmenu;
                }

                else{
                    br(2); pre(4); printf("Please Select From List :  "); Sleep(500);
                    goto adminchoise;
                }



            }

            else if(admin_panel_choice==1){
                goto mainmenu;
            }
            else{
                br(2); pre(4);  printf("Please Enter Correct Choice");
                goto adminpanelchoice;
            }

        }

        else if(main_menu_choice==3){
            cls();
            middle1(); pre(3); printf("Thank You For Using Our System. \n\t\t\tBrought To You By code-projects.org \n\n\n\n\n\n\n");
            Sleep(1000);

            exit(1);

        }

    }
    else{
        br(2); pre(4); printf("Please Enter Correct Choice"); Sleep(300);
        goto mainmenu;
    }


    int get_food_choice;


    br(2); pre(3);fflush(stdin);
    printf("Place Your Order: ") ;
    scanf("%d",&get_food_choice);

    if(get_food_choice==0){
        goto mainmenu;
    }

    node *temp;

    temp = list ;

    while(temp->data != get_food_choice){

        temp = temp->next;
        if(temp==NULL){
            br(2); pre(4);  echo("Please Choice From List: "); br(2); Sleep(1000);
            goto foodlist;
        }

    }
    if(get_food_choice == temp->data){

        fcquantity:
        br(2); pre(4);
        printf("Enter Item Quantity : ");

        int fcquantity;

        fflush(stdin); scanf("%d",&fcquantity); cls();



        if(fcquantity==0){
            cls(); middle1();pre(3); printf("Quantity Can not be Zero "); Sleep(2000);
            cls();
            goto foodlist;
        }
        else if(fcquantity>temp->quantity){
            cls(); middle1();pre(3); printf("Out of Stock ! "); Sleep(2000);

            goto foodlist;
        }

        middle1();pre(4);  printf("Choice item %s  its price is %0.2f \n\n",temp->foodname,temp->price*fcquantity);pre(4);
        printf("1. Confirm to buy this \n\n");pre(4);
        printf("2. Item List \n\n");
        printf("Press 1 to confirm and 2 to back to list :");

        confirm:
        int confirm;

        fflush(stdin); scanf("%d",&confirm);

        if(confirm == 1 ){

            br(2);pre(4);
            printf(" 1. Cash ");
            br(2);pre(4);
            printf(" 2. Credit\n");
            printf("Select Method Of payment 1-2: ");
            payment:
            int payment;

            fflush(stdin);  scanf("%d",&payment);

            if(payment==1){


                totalmoney += temp->price*fcquantity;
                order++;
                total_order[order]=get_food_choice;
                order_quantity[order]=fcquantity;
                uquantity = temp->quantity - fcquantity;

                updatefood(get_food_choice,uquantity);


                cls();middle1();pre(4);  printf("===>THANK YOU<===");
                br(2);pre(4);  printf("Item Ordered Successfully ...");
                br(2);pre(4);  printf("1. Wanna Buy Another Delicious ? ");
                br(2);pre(4);  printf("2. Main Menu \n");
                br(2);pre(4);   printf("Select: ");
                psmenu:
                int ps_menu;

                fflush(stdin);  scanf("%d",&ps_menu);

                if(ps_menu==1){goto foodlist;}
                else if(ps_menu==2){goto mainmenu;}
                else{br(2);pre(4);printf("Please Choice from list : "); goto psmenu;}

            }

            ///Credit Card Option

            else if(payment==2){

                int card_number[100];

                c++;

                cls();middle1();pre(4); printf("Enter Your Card No : ");

                fflush(stdin);   scanf("%d",&card_number[c]);



                cardno[c] = card_number[c];

                int pin;

                br(2);pre(2);  printf("Enter Your Card Pin [we never save your pin]  : ");

                fflush(stdin);     scanf("%d",&pin);

                cardmoney[c] = temp->price*fcquantity;

                totalmoney += temp->price*fcquantity;
                order++;
                total_order[order]=get_food_choice;
                order_quantity[order]=fcquantity;

                uquantity = temp->quantity - fcquantity;

                updatefood(get_food_choice,uquantity);

                br(2);pre(4);  printf("Payment Success...");
                br(2);pre(4);    printf("1. Wanna Buy Another Delicious ? ");
                br(2);pre(4);    printf("2. Main Menu \n");
                br(2);pre(4);   printf("select: ");
                psmenu2:
                int ps_menu2;

                scanf("%d",&ps_menu2);

                if(ps_menu2==1){goto foodlist;}
                else if(ps_menu2==2){goto mainmenu;}
                else{br(2);pre(4);printf("Please Choice from list : "); goto psmenu2;}

            }

            else{

                br(2);pre(4);   printf("Enter Choice from List : ");

                goto payment;


            }


        }    ///END Confirm Y/y



        else if(confirm == 2){

            goto foodlist;

        }

        else{
            br(2);pre(4);    printf("Enter Choice from List : ");

            goto confirm;


        }  ///end confirm;


    }  ///end get food choice if line


    else{

        br(2);pre(4);  echo("Please Choose From List "); br(2); Sleep(300);

        goto foodlist;

    }  ///end get food choice
}

void cls(){

    system("cls");

}

void echo(char print[]){

    printf("%s",print);
}

void br(int line){
    for(int i=0; i<line;i++){
        printf("\n");
    }
}

void pre(int tab){

    for(int i=0; i<tab;i++){
        printf("\t");
    }

}
void span(int space){

    for(int i=0; i<space;i++){
        printf(" ");
    }

}

void main_menu(){

    cls();
    br(5); pre(3); echo(">> 1. Bakery Item List"); Sleep(400);
    br(2); pre(3); echo(">> 2. Admin Panel"); Sleep(400);
    br(2); pre(3); echo(">> 3. Exit");  Sleep(400);
    //   br(2); pre(3); echo("=> 4. Admin Panel");  Sleep(400);

    br(1);

}

void insertend(int data, char foodname[25], int quantity, float price){

    node *temp;

    temp=(node *)malloc(sizeof(node));

    temp->data = data;

    temp->price = price;

    temp-> quantity = quantity;

    strcpy(temp->foodname,foodname);

    temp->next = NULL;


    if(head==NULL){
        head = temp;
        list = head;
    }
    else{

        while(head->next != NULL){
            head = head->next;
        }

        head->next = temp;
    }

}

void insertfirst(int data, char foodname[25], int quantity, float price){

    node *temp;

    temp=(node *)malloc(sizeof(node));

    temp->data = data ;

    temp->price = price;

    strcpy(temp->foodname,foodname);

    temp-> quantity = quantity;


    temp->next = head;

    head = temp;

    list = head ;

}

void insertmid(int pos, int data, char foodname[25], int quantity, float price){

    node *temp;

    temp=(node *)malloc(sizeof(node));

    temp->data = data;

    temp->price = price;

    temp-> quantity = quantity;

    strcpy(temp->foodname,foodname);

    while(head->next->data != pos ){


        head = head->next ;

    }

    temp->next = head->next;
    head->next = temp ;

    //    free(temp);
}

void deletefood(int serial){

    node *temp;
    temp=(node *)malloc(sizeof(node));

    temp = list;


    if(temp->data != serial){

        while(temp->next->data != serial){
            temp = temp->next;
        }

        if(temp->next->data == serial){

            temp->next = temp->next->next;
            cls();
            printf("\n\n\n\n\t\t\tDeleting Item %d ",serial);for(int cs=0;cs<4;cs++){printf(" .");Sleep(400);}

            printf("\n\n\n\n\t\t\tDeleted Successfully \n"); Sleep(500);

        }
        else{
            printf("\n\n\n\n\t\t\tCoffee Item Not Found\n"); Sleep(500);
        }

        head = temp ;

    }
    else{

        temp = temp->next;
        cls();
        printf("\n\n\n\n\t\t\tDeleting Item %d ",serial);for(int cs=0;cs<4;cs++){printf(" .");Sleep(400);}

        printf("\n\n\n\n\t\t\tDeleted Successfully \n"); Sleep(500);

        head = temp ;

        list=head;
    }
}

void updatefood(int udata, int uquantity){

    node *temp;
    temp = list;

    while(temp->data!=udata){
        temp = temp->next;

    }
    if(temp->data == udata){
        temp->quantity = uquantity;
    }

}

int countitem(){

    node *temp;

    temp = list;

    int countitem=0;

    if(temp==NULL){
        countitem = 0;
    }
    else{
        countitem = 1;
        while(temp->next != NULL){
            countitem++;
            temp = temp->next;
        }

    }


    return countitem;

}
void foodlist(){

    ccolor(0);

    printf("\n\t\t"); ccolor(240);
    printf("______________________________________________________ ");ccolor(26);
    printf("\n\t\t"); ccolor(240);
    printf("|  Item No.  |   Item Name   |  Price  |   In Stock   |");ccolor(26);
    printf("\n\t\t"); ccolor(240);
    printf("-------------------------------------------------------");ccolor(26);

    node *temp;

    temp = list;

    while(temp != NULL){

        ccolor(26);


        printf("\n\t\t"); ccolor(62);
        printf("|     %d      |    %s  |    %0.2f   |    %d    |",temp->data,temp->foodname, temp->price, temp->quantity);
        ccolor(26);
        printf("\n\t\t"); ccolor(62);
        printf("-------------------------------------------------------");


        temp = temp->next ;

        Sleep(100);

    }

    ccolor(26);

    //  free(temp);

}


void order_view(int order, int quantity, int or_no){



    ccolor(26);

    node *temp;

    temp = list;

    while(temp->data != order){

        temp = temp->next;

    }
    if(temp->data == order){

        ccolor(26);

        printf("\n\t\t"); ccolor(62);
        printf("|     %d      |    %s  |     %d     |     %d     |",or_no,temp->foodname,quantity,temp->quantity);
        ccolor(26);
        printf("\n\t\t"); ccolor(62);
        printf("-------------------------------------------------------");

        Sleep(100);

    }

    ccolor(26);

}

void ccolor(int clr){

    HANDLE  hConsole;
    hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    //SetConsoleTextAttribute(hConsole, clr);

//the above code displays colorful background. if you want colorful then you can remove the above comment but not the code, only comment//
}


///HEERE PRINTF STYLE FUNCTION

void pwellcome(){
    ccolor(26);

    char welcome[50]="WELCOME";
    char welcome2[50]=" TO";
    char welcome3[50]=" HAPPY BAKERY HOUSE";
    char welcome4[50]=" MANAGEMENT SYSTEM";
    printf("\n\n\n\n\n\t\t\t");
    for(int wlc=0; wlc<strlen(welcome);wlc++){

        printf(" %c",welcome[wlc]);
        Sleep(100);
    }
    ccolor(26);
    printf("\n\n\t\t\t\t ");
    for(int wlc2=0; wlc2<strlen(welcome2) ;wlc2++){

        printf(" %c",welcome2[wlc2]);
        Sleep(100);
    }
    ccolor(26);
    printf("\n\n\n\t\t\t ");
    for(int wlc3=0; wlc3<strlen(welcome3) ;wlc3++){
        if(welcome3[wlc3]!='D'){

            printf(" %c",welcome3[wlc3]);
        }
        else{

            printf(" %c",welcome3[wlc3]);
        }

        Sleep(100);
    }
    ccolor(26);
    printf("\n\n\n\t\t\t\t ");
    for(int wlc3=0; wlc3<strlen(welcome4) ;wlc3++){
        if(welcome4[wlc3]!='A' && welcome4[wlc3]!='E'){

            printf(" %c",welcome4[wlc3]);
        }
        else{

            printf(" %c",welcome4[wlc3]);
        }
        Sleep(100);
    }
    ccolor(26);

}
void loadingbar(void){

    for (int i=15;i<=100;i+=5){

        cls();

        printf("\n\n\n\n\n\n\n\t\t\t\t");
        printf("%d %% Loading...\n\n\t\t",i);

        printf("");

        for (int j=0; j<i;j+=2){

            ccolor(160+j);
            printf(" ");
            ccolor(26);

        }
        Sleep(100);
        if(i==90 || i==50 || i==96 || i==83){
            Sleep(100);
        }

    }

}
void backuploader(void){

    for (int i=15;i<=100;i+=5){

        cls();
        ccolor(26);

        printf("\n\n\n\n\n\n\n\t\t\t\t");
        printf("%d %% Backing UP DATA...\n\n\t\t",i);

        printf("");

        for (int j=0; j<i;j+=2){

            ccolor(120+j);
            printf(" ");
            ccolor(26);

        }
        Sleep(50);
        if(i==90 || i==50 || i==96 || i==83){
            Sleep(50);
        }
    }

}


void middle1(void){

    printf("\n\n\n\n\n\n\n");
}

void middtab1(void){
    printf("\t\t\t\t\t");
}

Now let us understand the code:-

  • We will start by writing the header of the code with the required libraries – stdio.h (standard input/output), stdlib.h (memory management), conio.h (console input/output), string.h (string manipulation),windows.h (for design functions),  time.h (time management).

Now we will declare the logic functions:

  • Update & Insert Function-
    void insertfirst(int data, char foodname[25], int quantity, float price); void insertmid(int pos, int data, char foodname[25], int quantity, float price); void insertend(int data, char foodname[25], int quantity, float price); void updatefood(int udata, int uquantity);
  • Display Function-
    void foodlist(); void order_view(int order, int quantity, int or_no); void main_menu();
  • Delete & Count Function-
    void deletefood(int serial); int countitem();
  • We will declare some extra design functions –
    void cls(); void echo(char print[]); void br(int line); void pre(int tab); void span(int space); void ccolor(int clr); void pwellcome(); void loadingbar(); void middle1(void); void middtab1(void); void backuploader(void);
  • Now we will start creating the program after function declarations. Create a structure – struct Node which will be used to store bakery items and their information such as foodname (to store the name of the bakery item), quantity, price and data. and next to store the address of the next node in the linked list.
  • The main() function will first set the console window title and size to be displayed when we run the program. We will then call a function called loadingbar() which will display a loading bar animation and then the function called pwellcome() to display a welcome message to the user. After a brief pause with sleep(300) the console is cleared with cls() function.
  • We will create and initialize variables in the main function to be used further in the program – c to count no. of card transactions, cardno for storing card numbers, cardmoney to store card transaction amounts, totalmoney to track the total cash transactions in the system, total_order to storw order numbers, order_quantity to store order quantities, order to track the current order number, uquantity to update item quantities, and citem to count the items.
  • Then we will initialize the linked list by calling the function called insertfirst() and insertend() to add several bakery items to the list.
  • The main_menu() function will display main menu for the bakery system on the console. We will use nest if-else statements to select between the menu options
  • For the admin panel, the login password is 1234567.
  • The insert functions will insert the data into the lists.
  • For the payment options after the customer completes their purchase of items program asks the user to select a payment method, either cash or credit. If the user picks cash, the program requests the amount and computes the change. The order’s cost is then added to the overall amount earned for the day, and the quantity in stock for the selected item is updated. If the user chooses credit, the program requests the credit card number and deducts the amount of the order from the card’s available balance.
  • The deletefood() function will deleted a food item from the list.
  • The updatefood() function will update the food quantity in the system.
  • The countitem() function will count the no. of food items available in the system.
  • The foodlist() function will display the list of food items on the console with itwm no., item name, price and stock availability.
  • The order_view() function function will let you view your order.
  • After all the logic function definitions, we will define some design functions to create the UI of the project for the system to look organized and to make it easy to use.
  • This sums up our project of a Bakery Management System using C++.

Canteen Management System using C++ (With Source Code)

Final Output:-

Here is an example to show how this project works.

Bakery Management System using C++

Bakery Management System using C++

Menu options

Bakery Management System using C++

Selecting option 1  –

Bakery Management System using C++

Placing an order:

Bakery Management System using C++

Bakery Management System using C++

Bakery Management System using C++

Logging in the Admin Panel

Bakery Management System using C++ (With Source Code)

ADVERTISEMENT

Conclusion

We have reached the end of this article and have a lot 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.

ADVERTISEMENT

Canteen Management System using C++ (With Source Code)

ADVERTISEMENT

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

ADVERTISEMENT

Thank you.

ADVERTISEMENT

Happy Reading! 🙂

Follow: CodewithRandom



Leave a Reply