Parking Management System In C Language
PURPOSE : PARKING MANAGEMENT SYSTEM
DATE : 5 JULY 2020*/
#include <stdio.h>
#include <conio.h>
// including the functions by calling
int menu(); // menu returns an int value
void bus();
void riksha();
void car();
void bike();
void cycle();
void showdetail();
void delete ();
// Global variables
// nor = No of riksha
// nob = NO of bus
// noc = NO of car
// nobi = NO of bike
// nocy = NO of cycle
// amt = Total amount
// count = NO of vehicles
int nor = 0, nob = 0, noc = 0, nobi = 0;
int nocy = 0, amt = 0, count = 0;
void main(void)
{
int i;
for (i = 0; i < 10000; i++)
{
switch (menu())
// calling menu function
{
case 1:
bus();
//if press 1 this function will be called
break;
case 2:
riksha();
//if press 2 this function will be called
break;
case 3:
car();
//if press 3 this function will be called
break;
case 4:
bike();
//if press 4 this function will be called
break;
case 5:
cycle();
//if press 5 this function will be called
break;
case 6:
showdetail();
//if press 6 this function will be called
break;
case 7:
delete ();
//if press 7 this function will be called
break;
case 8:
goto end;
break;
default:
printf("\n\tINVALIDE CHOICE");
break;
}
}
end:
getch();
}
int menu(void)
{
int ch = 0;
printf("\n1. ENTER BUS");
printf("\n2. ENTER RIKSHA");
printf("\n3. ENTER CAR");
printf("\n4. ENTER BIKE");
printf("\n5. ENTER CYCLE");
printf("\n6. SHOW DETAILS");
printf("\n7. DELETE DETAILS");
printf("\n8. EXIT");
printf("\n\nENTER YOUR CHOICE\t");
scanf("%d", &ch);
return (ch);
}
// If delete function is called
// All values become 0
void delete (void)
{
nor = 0;
nob = 0;
noc = 0;
nobi = 0;
nocy = 0;
amt = 0;
count = 0;
}
void showdetail(void)
{
printf("\nNO OF BUSES = %d", nob);
printf("\nNO OF RIKSHA = %d", nor);
printf("\nNO OF CARS = %d", noc);
printf("\nNO OF BIKES = %d", nobi);
printf("\nNO OF CYCLES = %d", nocy);
printf("\nTOTAL AMOUNT = %d", amt);
printf("\nTOTAL NO OF VEHICLES = %d", count);
}
void bus(void)
{
printf("Done");
nob++; //Increment in No of bus
amt = amt + 100; //Increment in amount
count++; //Increment in No of vehicles
}
void riksha(void)
{
printf("Done");
nor++; // Increment in No of riksha
amt = amt + 50; // Increment in amount
count++; // Increment in No of vehicles
}
void car(void)
{
printf("Done");
noc++; // Increment in No car
amt = amt + 70; // Increment in amount
count++; // Increment in No of vehicles
}
void bike(void)
{
printf("Done");
nobi++; // Increment in No of bike
amt = amt + 30; // Increment in amount
count++; // Increment in No of vehicles
}
void cycle(void)
{
printf("Done");
nocy++; // Increment in No of cycle
amt = amt + 10; // Increment in amount
count++; // Increment in No of vehicles
}
OUTPUT
1. ENTER BUS
2. ENTER RIKSHA
3. ENTER CAR
4. ENTER BIKE
5. ENTER CYCLE
6. SHOW DETAILS
7. DELETE DETAILS
8. EXIT
ENTER YOUR CHOICE 6
NO OF BUSES = 1
NO OF RIKSHA = 1
NO OF CARS = 1
NO OF BIKES = 1
NO OF CYCLES = 1
TOTAL AMOUNT = 260
TOTAL NO OF VEHICLES = 5
1. ENTER BUS
2. ENTER RIKSHA
3. ENTER CAR
4. ENTER BIKE
5. ENTER CYCLE
6. SHOW DETAILS
7. DELETE DETAILS
8. EXIT
ENTER YOUR CHOICE 7
1. ENTER BUS
2. ENTER RIKSHA
3. ENTER CAR
4. ENTER BIKE
5. ENTER CYCLE
6. SHOW DETAILS
7. DELETE DETAILS
8. EXIT
ENTER YOUR CHOICE 6
NO OF BUSES = 0
NO OF RIKCHA = 0
NO OF CARS = 0
NO OF BIKES = 0
NO OF CYCLES = 0
TOTAL AMOUNT = 0
TOTAL NO OF VEHICLES = 0
1. ENTER BUS
2. ENTER RIKSHA
3. ENTER CAR
4. ENTER BIKE
5. ENTER CYCLE
6. SHOW DETAILS
7. DELETE DETAILS
8. EXIT
ENTER YOUR CHOICE 8 //EXIT FROM THE LOOP//
e:\PROJECT\C>
ReplyDeleteHello this is a program for Parking management system
Ooooh blog
ReplyDeleteWeldone janish
ReplyDelete