MINI PROJECT OF C-PROGRAMMING
CAR PARKING MANAGEMENT
//header files\
#include<stdio.h>
#include<conio.h>
//global variable declaration
//no2=number of two whellers
//n03=number of three whellers
//no4= number of four whellers
//amount=total income of today
int no2=0,no3=0,no4=0,amount=0;
//mainfunction
main()
{
int i;
for(i=1;i<10000;i++)
{
menu();
}
}
//menu function
int menu()
{
int ch;
printf("\n******MENU******\n1.press '1' for entry.\n2.press '2' for exist.\n3.press '3' for status");
printf("\nenter your choice:-");
scanf("%d",& ch);
switch(ch)
{
case 1:
{
entry();
break;
}
case 2:
{
exist();
break;
}
case 3:
{
display();
break;
}
}
return 0;
}
//entry function
int entry()
{
int choice_entry;
printf("\n*****MENU*****\n1.press '1' for two whellers.\n2.press '2' for three whellers.\n3.press '3' for four whellers.\n enter your choice:-");
scanf("%d",& choice_entry);
switch(choice_entry)
{
case 1:
{
two_whellers_entry();
break;
}
case 2:
{
three_whellers_entry();
break;
}
case 3:
{
four_whellers_entry();
break;
}
}
return 0;
}
//exist function
int exist()
{
int choice_exist;
printf("\n*****MENU*****\n1.press '1' for two whellers.\n2.press '2' for three whellers.\n3.press '3' for four whellers.\n enter your choice:-");
scanf("%d",& choice_exist);
switch(choice_exist)
{
case 1:
{
two_whellers_exist();
break;
}
case 2:
{
three_whellers_exist();
break;
}
case 3:
{
four_whellers_exist();
break;
}
}
return 0;
}
//display function
int display()
{
printf("\nTotal number of two_whellers in the garage:-%d",no2);
printf("\nTotal number of three_whellers in the garage:-%d",no3);
printf("\nTotal number of four_whellers in the garage:-%d",no4);
printf("\n Total income of today:-%d",amount);
return 0;
}
//two whellers entry
int two_whellers_entry()
{
int a;
printf("\nenter the number of two_whellers($10):-");
scanf("%d",& a);
no2=no2+a;
amount=amount+(a*10);
}
//three whellers entry
int three_whellers_entry()
{
int b;
printf("\nenter the number of three_whellers($20):-");
scanf("%d",& b);
no3=no3+b;
amount=amount+(b*20);
}
//four whellers entry
int four_whellers_entry()
{
int c;
printf("\nenter the number of four_whellers($30):-");
scanf("%d",& c);
no4=no4+c;
amount=amount+(c*30);
}
//two whellers exist
int two_whellers_exist()
{
int a;
printf("\nenter the number of three_whellers:-");
scanf("%d",& a);
no2=no2-a;
}
//three whellers exist
int three_whellers_exist()
{
int b;
printf("\nenter the number of three_whellers:-");
scanf("%d",& b);
no3=no3-b;
}
//four whellers exist
int four_whellers_exist()
{
int c;
printf("\nenter the number of three_whellers:-");
scanf("%d",& c);
no4=no4-c;
}
No comments:
Post a Comment