Sekiranya anda sedang mencari program parking sistem dalam c programming yang simple untuk projek atau assignment anda bolehlah mengunakan c-programming parking sistem ini sebagai rujukan. Program ini hanya mengunakan array, input output file dan loops sahaja. Program ini dibuat mengunakan software c-free iaitu software yang free untuk programming yang simple. Sekiranya anda mengunakan software lain seperti dev c++ atau lain-lain juga boleh untuk run coding ni tapi mungkin kena ubah sedikit.
DOWNLOAD C-FREE | 15MB |
CODING:-
#include<stdio.h>
void menu(void);
void registration(void);
void display(void);
void end(void);
int park[10]={0,1,2,3,4,5,6,7,8,9};
int main()
{
int x,v,s,y,k,m,n;
e: menu();
printf("Enter Your Option : ");
scanf("%d",&x);
printf("\n");
if(x==1)
{
w: printf("PARKING REGISTRATION\n\n");
printf("1.Choose Parking Lot To Register\n");
printf("2.View Parking Lot\n");
printf("3.Back To Main Menu\n\n");
printf("Rules : Parking Must Be Register On Empty Parking Lot Only!!\n\n\n");
printf("Enter Your Option : ");
scanf("%d",&y);
printf("\n\n");
if(y==1)
{
system("cls");
printf("List Of Parking : \n\n");
printf("Parking Lot 0\n");
printf("Parking Lot 1\n");
printf("Parking Lot 2\n");
printf("Parking Lot 3\n");
printf("Parking Lot 4\n");
printf("Parking Lot 5\n");
printf("Parking Lot 6\n");
printf("Parking Lot 7\n");
printf("Parking Lot 8\n");
printf("Parking Lot 9\n\n");
printf("Choose Parking : ");
scanf("%d",&m);
printf("\n\n");
switch(m)
{
case 0 :
registration();
printf("Your Parking ID is : 1231 \n\n");
goto w;
case 1 :
registration();
printf("Your Parking ID is : 1232\n\n");
goto w;
case 2 :
registration();
printf("Your Parking ID is : 1233\n\n");
goto w;
case 3 :
registration();
printf("Your Parking ID is : 1234\n\n");
goto w;
case 4 :
registration();
printf("Your Parking ID is : 1235\n\n");
goto w;
case 5 :
registration();
printf("Your Parking ID is : 1236\n\n");
goto w;
case 6 :
registration();
printf("Your Parking ID is : 1237\n\n");
goto w;
case 7 :
registration();
printf("Your Parking ID is : 1238\n\n");
goto w;
case 8 :
registration();
printf("Your Parking ID is : 1239\n\n");
goto w;
case 9 :
registration();
printf("Your Parking ID is : 1230\n\n");
goto w;
default : goto e;
}
}
else if(y==2)
{
display();
goto w;
}
else
goto e;
}
else if(x==2)
{
printf("Enter ID Password: ");
scanf("%d",&v);
if(v==1231)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[0]=k;
goto e;
}
if(v==1232)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[1]=k;
goto e;
}
if(v==1233)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[2]=k;
goto e;
}
if(v==1234)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[3]=k;
goto e;
}
if(v==1235)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[4]=k;
goto e;
}
if(v==1236)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[5]=k;
goto e;
}
if(v==1237)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[6]=k;
goto e;
}
if(v==1238)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[7]=k;
goto e;
}
if(v==1239)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[8]=k;
goto e;
}
if(v==1230)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[9]=k;
goto e;
}
else
{
printf("Wrong Password\n\n");
goto e;
}
}
else if(x==3)
{
display();
goto e;
}
else if(x==4)
{
printf("Enter ID Password: ");
scanf("%d",&v);
if(v==1231)
{
printf("Thank You!! : ");
printf("\n\n");
park[0]=0;
goto e;
}
if(v==1232)
{
printf("Thank You!! : ");
printf("\n\n");
park[1]=0;
goto e;
}
if(v==1233)
{
printf("Thank You!! : ");
printf("\n\n");
park[2]=0;
goto e;
}
if(v==1234)
{
printf("Thank You!! : ");
printf("\n\n");
park[3]=0;
goto e;
}
if(v==1235)
{
printf("Thank You!! : ");
printf("\n\n");
park[4]=0;
goto e;
}
if(v==1236)
{
printf("Thank You!! : ");
printf("\n\n");
park[5]=0;
goto e;
}
if(v==1237)
{
printf("Thank You!! : ");
printf("\n\n");
park[6]=0;
goto e;
}
if(v==1238)
{
printf("Enter Car No : ");
scanf("%d",&k);
printf("\n\n");
park[7]=k;
goto e;
}
if(v==1239)
{
printf("Thank You!! : ");
printf("\n\n");
park[8]=0;
goto e;
}
if(v==1230)
{
printf("Thank You!! : ");
printf("\n\n");
park[9]=0;
goto e;
}
else
{
printf("Wrong Password\n\n");
goto e;
}
}
else
end();
}
void menu(void)
{
printf("|WELCOME TO PARKING SYSTEM|\n\n");
printf("1.Parking Registeration\n");
printf("2.Login To Your Account\n");
printf("3.View Parking\n");
printf("4.Exit Parking\n");
printf("5.Exit Program\n\n");
}
void display(void)
{
int i;
printf("LIST OF PARKING : \n\n");
for(i=0;i<10;i++)
printf("%d ",park[i]);
printf("\n\n\n\n");
}
void registration(void)
{
char u[30];
char o[30];
FILE *parklot;
parklot=fopen("parking.txt","a");
printf("Enter Name : ");
scanf("%s",&o);
printf("Enter Car Plate : ");
scanf("%s",&u);
fprintf(parklot,"Name : %s Car Plate : %s\n\n",o,u);
fclose(parklot);
}
void end(void)
{
system("cls");
printf("\t\t\tTHANK YOU FOR USING THIS SERVICES\n");
printf("\t\t\t\t Visit Us At \n\n");
printf("\t\t\t securityparking.com.my\n\n\n");
printf(" First Programmer : Khairul\n");
printf(" First Programmer : Kasyful\n");
printf(" Reported By : Rabiatul\n");
printf(" Prepared By : Salem!!!!\n\n\n\n");
}
No comments:
Post a Comment