VOOZH about

URL: https://www.geeksforgeeks.org/c/food-ordering-system-in-c/

⇱ Food Ordering System in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Food Ordering System in C

Last Updated : 15 Jul, 2025

Prerequisite: Modular Approach in Programming : Write C program to implement Food ordering with the following functionalities:

  • Login & Signup
  • Search by Food
  • Search by hotels
  • Cart & Order Confirmation

:

This is the main function for signup, From here we are calling the account_check() function to validate the inputs. Following are the functionalities:

  • Input the username, age, email, password, confirm the password, and mobile number.
  • Validate the inputs
    • Username must contain alphabets.
    • Age must be greater than and not equal to 0.
    • Email must contain @, a comma and length should be greater than 5.
    • Passwords must contain length between 8 to 12 with at least one uppercase, lowercase, number and special character. Both password and confirm password should be the same.
    • Mobile number should contain numbers and exactly 10 digits.

After the successful validation of all input fields, it checks whether the same account already exists or not through account_check() functionality.

This function implements the login features of our project. While login, the Email, and Password are validated and checked whether it is already signed up. After the successful login, there is an option to choose either Search_by_food() or Search_by_hotels() functionalities.

In this functionality, the food order is placed after selecting any Hotel. Once the hotel is selected the list of food is displayed with their respective costs. Once the food is selected, you need to go to option Select Cart for the successful ordering of the foods.

Before ordering by the hotel, initialize some default hotels which we are given locally through structures in C for our demonstration. Once the hotels and their respective foods are initialized dynamically, it will display the list of hotels.

Once the hotel is selected in the above step, select the food and enter the number of items to order. Once the selection of all the foods is done it will display the total amount of food selected. Move to Select Cart for the successful ordering of the foods.

This functionality perform the following:

  • Display the total cost of your orders.
  • Confirm your order and enjoy your food.

:

Boilerplate Code:

👁 Image
 

Signup:

👁 Image
 

Login:

👁 Image
 

Validate:

👁 Image
 

Account Check:

Account Already exist:

👁 Image
 

Account doesn't Exist:

👁 Image
 

Search By Hotels:

👁 Image
 

Search By Food:

👁 Image
 

Cart:

👁 Image
 
Comment
Article Tags: