Page

Lift Management System In C/C++

#include<stdio.h>
#include<conio.h>
#include<dos.h>
void ground();
void first();
void second();
void third();
void fourth();
void fifth();
void sixth();
void seventh();
void eighth();
void ninth();
void main()
{
int ch;
clrscr();
printf("\n\nEnter floor No:");
scanf("%d",&ch);
switch(ch)
{
case 1:
first();
break;
case 2:
second();
break;
case 3:
third();
break;
case 4:
fourth();
break;
case 5:
fifth();
break;
default:
printf("\nPls Enter valid No:");
break;
}
getch();
}
void first()
{
int i;
printf("\n\nYou are going to first Floor:");
printf("\n\nTime is left:");
for(i=9;i>=0;i--)
{
delay(2000);
printf("%d\b",i);
}
printf("\n\nLift is Stop Pls get down");
sound(300);
delay(3000);
nosound();
}
void second()
{
int i;
first();
clrscr();
printf("\nNow you are going second floor");
printf("\n\nTime left : ");
for(i=9;i>=0;i--)
{
delay(2000);
printf("%d\b",i);
}
printf("\n\nLift is Stop Pls get down");
sound(500);
delay(3000);
nosound();
}
void third()
{
int i;
second();
clrscr();
printf("\nNow you are going to Third floor");
printf("\n\nTime left : ");
for(i=9;i>=0;i--)
{
delay(2000);
printf("%d\b",i);
}
printf("\n\nLift is stop Pls get down");
sound(500);
delay(3000);
nosound();
}
void fourth()
{
int i;
third();
clrscr();
printf("\nNow you are going to Fourth floor");
printf("\n\nTime left : ");
for(i=9;i>=0;i--)
{
delay(2000);
printf("%d\b",i);
}
printf("\n\nLift is stop Pls get down");
sound(500);
delay(3000);
nosound();
}
void fifth()
{
int i;
fourth();
clrscr();
printf("\nNow you are going to fifth floor");
printf("\n\nTime left : ");
for(i=9;i>=0;i--)
{
sound(500);
delay(2000);
nosound();
printf("%d\b",i);
}
printf("\n\nLift is stop Pls get down");
delay(3000);
}
void sixth()
{
int i;
fifth();
clrscr();
printf("\nNow you are going to sixth floor");
printf("\n\nTime left : ");
for(i=9;i>=0;i--)
{
sound(500);
delay(2000);
nosound();
printf("%d\b",i);
}
printf("\n\nLift is stop Pls get down");
delay(3000);
}
void seventh()
{
int i;
sixth();
clrscr();
printf("\nNow you are going to seventh floor");
printf("\n\nTime left : ");
for(i=9;i>=0;i--)
{
delay(2000);
printf("%d\b",i);
}
printf("\n\nLift is stop Pls get down");
sound(500);
delay(3000);
nosound();
}

No comments:

Post a Comment