Lab Report-C# Classes development
Lab Report-C# Classes development
Introduction
This report explains how the main C# classes were created for the Restaurant Billing System.
The goal was to build a simple and organized backend for the system. These core classes are
important because they handle the main functions and make the system easy to manage and
expand.
The focus was on creating basic classes for key parts of the system, like customers, orders, and
menu items. A good class design makes the code easier to reuse, read, and improve in the future.
Methodology
The development of core C# classes was done step by step:
1. Understanding Requirements
First, we identified the main parts of the system and what information each part needs:
• Customer: This class represents the people placing orders. It includes details like Name,
Contact Number, and Address.
• MenuItem: This class represents the food items available in the restaurant. It includes
details like Item Name, Price, and Category.
• Order: This class represents an order placed by a customer. It includes details like Order
ID, Customer Information, List of Items, and Total Amount.
2. Designing Classes
We made diagrams to show how the different parts of the system are connected. The following
classes were created:
1. Customer Class
o Details: Name, Contact Number, Address
o Actions: PlaceOrder(), ViewOrderHistory()
2. MenuItem Class
o Details: Item Name, Price, Category
o Actions: UpdatePrice(), GetItemDetails()
3. Order Class
o Details: Order ID, Customer Info, Items List, Total Amount
o Actions: CalculateTotal(), AddItem(), RemoveItem(), GetOrderDetails()
The classes were coded in C# using Visual Studio. We used key programming ideas like:
• Encapsulation: Keeping class details private and using public methods to access them.
• Inheritance: Using a base class to share common features between different classes.
• Polymorphism: Allowing the same method to do different things depending on the
object.
After creating the classes, we tested them to make sure they worked correctly. The testing
process included:
• Reusable Code: The classes can be used in different parts of the system.
• Easy to Maintain: The structure makes it simple to update and manage the system.
• Expandable: New features can be added without changing the existing code too much.
• Error Handling: Adding better error handling will make the classes more reliable.
• New Features: We can add more features like discounts and promotions.
Conclusion
The Core C# Classes Development for the Restaurant Billing System helped build a solid
backend. The simple and organized class structure makes the system efficient, easy to maintain,
and ready for future updates.
Future Improvements