Skip to content

Latest commit

 

History

History
240 lines (147 loc) · 4.03 KB

File metadata and controls

240 lines (147 loc) · 4.03 KB

☕ Cafe Management System

A console-based Cafe Management System built in Java as part of my Programming Fundamentals coursework.

The application allows customers to browse the menu, place orders, and generate receipts, while administrators can manage menu items. It uses Java file handling to store menu data and customer order history, ensuring data persists between program executions.


⭐ Features

Customer Panel

  • View available menu items
  • Place customer orders
  • Select item quantities
  • Generate itemized receipts
  • Save order history to orders.txt

Admin Panel

  • View the current menu
  • Add new menu items
  • Remove existing menu items
  • Save updated menu data to menu.txt

💡 Programming Concepts Practiced

This project was developed to strengthen core Programming Fundamentals concepts, including:

  • Arrays & Parallel Arrays
  • Methods
  • Loops (for and do-while)
  • Conditional Statements
  • Switch Case
  • File Handling
  • Exception Handling

📂 Data Persistence

The application stores data using two text files.

menu.txt

Stores menu items and their prices.

Example:

Burger,15.99
Pizza,30.59
Shawarma,10.09

orders.txt

Stores customer receipts and order history so previous orders are preserved.


⚙️ How It Works

  1. Load menu data from menu.txt.
  2. Display the main menu.
  3. Allow customers to browse and place orders.
  4. Generate and save customer receipts.
  5. Allow administrators to manage menu items.
  6. Automatically save menu updates and order history.

🛠️ Technologies Used

  • Java
  • Zed IDE
  • Java File I/O
  • File
  • FileWriter
  • PrintWriter
  • Scanner

📁 Project Structure

CafeManagementSystem/
│
├── screenshots/
│   ├── code_snippets/
│   └── output/
│
├── CafeManagementSystem.java
├── menu.txt
├── orders.txt
├── .gitignore
└── README.md

▶️ How to Run

Compile

javac CafeManagementSystem.java

Run

java CafeManagementSystem

📸 Screenshots

Main Menu

Main Menu

Customer Ordering

Customer Ordering

Customer Receipt

Customer Receipt

Return to Main Menu

Return

Admin Panel

Admin Panel

Add Menu Item

Add Item

Remove Menu Item

Remove Item

Navigation

Navigation

Program Exit

Exit


💻 Code Highlights

Menu Display

Code Snippet 1

Menu File Handling

Code Snippet 2

Loading Menu Data

Code Snippet 3

Main Menu Logic

Code Snippet 4

Customer Ordering Logic

Code Snippet 5

Quantity & Billing

Code Snippet 6

Receipt Generation

Code Snippet 7

Saving Orders

Code Snippet 8

Admin Panel Logic

Code Snippet 9

Add Menu Items

Code Snippet 10

Remove Menu Items

Code Snippet 11


📚 Learning Outcomes

Through this project, I strengthened my understanding of:

  • Java programming fundamentals
  • Problem solving
  • Arrays and methods
  • File handling
  • Exception handling
  • Structuring console-based applications

🚀 Future Improvements

Potential enhancements include:

  • Java Swing or JavaFX GUI
  • Database integration
  • Improved input validation
  • Dynamic menu management using ArrayList
  • Admin authentication

👨‍💻 Author

Muhammad Abdullah

BSCS Student at COMSATS University Islamabad

GitHub: https://github.com/abdullahcodes-dev