0% found this document useful (0 votes)
4 views6 pages

C Programming Project Report

The Parking Lot Management System is a console application developed in C to automate vehicle parking, track available spaces, and calculate revenue. It addresses the inefficiencies of manual parking management by providing a structured digital tool that allows users to park, remove vehicles, and view occupancy in real-time. The project utilizes arrays, switch-case logic, and input validation to ensure data integrity and enhance user experience.

Uploaded by

renukank885
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

C Programming Project Report

The Parking Lot Management System is a console application developed in C to automate vehicle parking, track available spaces, and calculate revenue. It addresses the inefficiencies of manual parking management by providing a structured digital tool that allows users to park, remove vehicles, and view occupancy in real-time. The project utilizes arrays, switch-case logic, and input validation to ensure data integrity and enhance user experience.

Uploaded by

renukank885
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C Programming Project Report

Course: Principles of Programming using C ()

Course Code: BPOPS24103

Semester: I

Title of the Project:

Submitted by:

USN Name of the Student

1GA25CS179-T MAYUR TEJASWI M

1GA25CS028-T RAHUL C GOWDA

1GA25CS119-T RESHMA K SAJJAN

Name of the Guide/ Subject Incharge:


Project Report: Parking Lot Management System

1. Abstract

The Parking Lot Management System is a console-based application developed in the C


programming language. It is designed to automate the process of vehicle parking, tracking
available spaces, and calculating revenue. By replacing manual entry systems with a
structured digital approach, it ensures better organization and minimizes errors in slot
allocation.

2. Introduction & Motivation

Introduction: This project provides a simplified interface for managing a parking facility
with a fixed number of slots. It allows a user to park a vehicle, remove it, and view the
current occupancy map. Motivation: Most small parking areas still rely on paper logs, which
are difficult to manage and update. The motivation for this project was to apply basic C
concepts to create a digital tool that provides instant updates on space availability and
financial records.

3. Problem Statement

Manual management of parking spaces often leads to confusion regarding which slots are
empty, resulting in wasted time and potential overbooking. Additionally, calculating total
daily earnings manually can be tedious. There is a need for a simple system that tracks
occupancy and revenue in real-time.

4. Objectives

• To design a menu-driven program for easy navigation.


• To manage 10 parking slots using an array-based data structure.

• To implement a revenue tracking system in Rupees (Rs.).

• To ensure data integrity by validating user inputs (e.g., checking if a slot is already
occupied).

5. Hardware and Software Requirements

• Hardware: A computer system with at least 4GB RAM and a standard


keyboard/monitor.

• Software: Windows or Linux Operating System, GCC Compiler, and an IDE (like
VS Code, Dev-C++, or Code::Blocks).

6. System Design (C Concepts Used)

• Arrays: An integer array slots[10] is used to store the status of each parking space (0
for empty, 1 for occupied).
• Switch-Case Logic: Used to create the main menu, directing the user to different
functions like "Park" or "Status."

• Loops: A while(1) loop keeps the program running until the user chooses to exit, and
for loops are used to display the parking map.

• Conditional Statements: if-else blocks handle validation, such as checking if a slot


number is within the valid range (1–10).

7. Implementation

• The implementation of the Parking Lot Management System is carried out using a
modular approach within the main() function. The process is broken down into the
following key steps:

• A. Data Initialization

• Storage: An integer array slots[10] is initialized to zero using {0}. This represents 10
empty parking spaces.
• Trackers: Two integer variables, occupied and total_earned, are used to keep track of
the current number of cars and the total revenue in Rupees, respectively.

• B. Main Control Loop

• The program uses a while(1) infinite loop to keep the application running. This allows
the user to perform multiple operations (like parking and then checking status)
without the program closing unexpectedly.
• C. Menu-Driven Logic (Switch-Case)

• The switch-case structure acts as the command center. Based on the user’s input (1, 2,
or 3), the program jumps to the specific logic for that task:
• Case 1 (Parking): The program asks for a slot number. It first checks if the input is
between 1 and 10. If valid, it checks if(slots[spot-1] == 0). If empty, it changes the
value to 1 and increments the occupied counter.

• Case 2 (Removal & Billing): When a car is removed, the program resets the array
value to 0, decrements the occupied counter, and adds Rs. 50 to the total_earned
variable.

• Case 3 (Display): A for loop iterates through the array. It uses a conditional (ternary)
operator to print an [X] if the slot is 1 (occupied) or an empty bracket [ ] if the slot is
0.

• D. Input Validation

• To prevent the program from crashing or recording incorrect data, if-else statements
are used to ensure the user only selects slots between 1 and 10. This ensures the
program does not try to access memory outside the array's bound
8. C Code Snippet

#include <stdio.h>

int main() {

int slots[10] = {0};

int choice, spot, total_earned = 0, occupied = 0;

while(1) {

printf("\n--- Parking Manager ---");

printf("\nAvailable: %d | Occupied: %d | Total Earnings: Rs. %d", 10 - occupied,


occupied, total_earned);

printf("\n1. Park Car\n2. Remove Car\n3. View Status\n4. Exit\nChoice: ");

scanf("%d", &choice);

if(choice == 4) break;

switch(choice) {

case 1:

printf("Enter slot (1-10): ");

scanf("%d", &spot);
if(spot < 1 || spot > 10) printf("Invalid slot!\n");

else if(slots[spot-1] == 1) printf("Slot already full!\n");

else {

slots[spot-1] = 1;

occupied++;

printf("Car parked!\n");

}
break;
case 2:

printf("Enter slot to free: ");

scanf("%d", &spot);

if(spot >= 1 && spot <= 10 && slots[spot-1] == 1) {


slots[spot-1] = 0;

occupied--;

total_earned += 50;

printf("Slot freed. Fee: Rs. 50\n");

} else printf("Slot is already empty or invalid!\n");

break;

case 3:
printf("\nParking Map: ");
for(int i=0; i<10; i++) printf("[%s] ", slots[i] == 1 ? "X" : " ");

printf("\n");

break;

default: printf("Invalid option!\n");

return 0;
}

9. Expected Output / Snapshots

The program starts by displaying a dashboard with 10 available slots and Rs. 0 earnings.

• Park Car: If slot 2 is chosen, the "Available" count drops to 9 and "Occupied"
becomes 1.

• Status: Choosing option 3 prints: [ ] [X] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] (indicating slot 2 is


full).

• Remove Car: When slot 2 is cleared, the system displays "Fee collected: Rs. 50" and
the total earnings update.

10. Conclusion
The Parking Lot Management system successfully demonstrates how fundamental C
programming logic can solve administrative problems. By using arrays and control structures,
the project provides a reliable way to manage parking logistics and financial records in a
small-scale environment.
11. Future Enhancements

• File Handling: Saving the parking data and total earnings to a text file so data is not
lost when the program closes.
• Dynamic Pricing: Implementing a system that charges based on how many minutes
the car was parked.
• Search Feature: Allowing users to find a car based on a unique registration number

You might also like