This project was developed as Assignment 2 for the CIS*2520 Data Structures course at the University of Guelph. It encompasses two main components:
- Car Rental System: A simulation of a car rental company utilizing data structures such as singly linked lists, stacks, and merge sort algorithms.
- RPN Calculator: An implementation of a Reverse Polish Notation calculator using stack data structures.
- Singly Linked Lists: Manage the dynamic lists of cars.
- Stacks: Implement the RPN calculator and manage certain operations within the car rental system.
- Merge Sort: Sort the car lists based on specific criteria.
The Car Rental System is designed to manage a fleet of cars categorized into three lists efficiently:
- Available for Rent
- Rented
- In Repair
- Add New Cars: Introduce new vehicles into the system.
- Rent Cars: Move cars from the available list to the rented list.
- Return Cars: Transition cars from rented to available or repair lists based on their condition.
- Transfer to Repair: Shift cars from available or rented lists to the repair list.
- Transfer from Repair: Move cars from the repair list back to the available list.
- Display Lists: View the current status of all three car lists.
- Save and Load Data: Persist and retrieve car lists to and from text files.
The Reverse Polish Notation (RPN) Calculator evaluates mathematical expressions written in postfix notation. This component demonstrates the application of stack data structures.
- Evaluate Expressions: Compute results for valid RPN expressions.
- Error Handling: Identify and report errors in invalid expressions.
-
Clone the Repository:
git clone https://github.com/Danial-Changez/Car-Rental-System-and-RPN.git
-
Compile the Programs:
make
- Run the Car Rental System:
./a2q1
- Run the RPN Calculator:
- Sample test case provided
./a2q2 512+4*+3-
Note: Ensure you have a C compiler and make utility installed on your system.
The following resources supported the development of this project:
- Course Materials: Slides and notes on singly linked lists, stacks, and merge sort algorithms.
- Online References: