want a free source code for hotel reservation. am using Dev C
//this work was coded by SHUMAI NYAGURA
//header files declaration
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define size 30
//function initial declaration
void mainm(void);
void entry(void);
void alter(void);
void delet(void);
void view(void);
void checkout(void);
void passkey(void);
void exiting(void);
void error(void);
void guestlist(void);
//begining of structure hotelsystem
struct hotelsystem
{
char name[size][35], visitor_
};
struct hotelsystem guest;
struct hotelsystem1
{
char name[size][30], visitor_
};
struct hotelsystem1 guest1;
int li,lp,single_
int dr[size];
int rno,rnum;
int i;
int e;
char rc,ch,selection
float days,hrate,
FILE *f;
int main(void)
{
system("color 0f");
printf(
getch();
passkey(
}
void mainm(void)
{
single_room[0]=1;
dr[
system("cls");
system("color a");
selection=
switch(
{
case '1':entry();
case '2':checkout();
case '3':alter();
case '4':view();
case '5':guestlist();
case '6':delet();
case '7':exiting();
default:{
}
}
}
void entry(void)//call entry function
{
system("cls");
system("color 0f");
for(
printf(
for(
printf(
printf("WE ONLY OFFER DOUBLE OR SINGLE ROOMS: DO YOU WANT TO CONTINUE RESERVING A ROOM? ( Y / N )\n");
eselection
eselection
switch(
{
//Data Entry Function End
//call Guest Data View Fucntion
void view(void)
{
system("cls");
system("color 0f");
for(
printf(
for(
printf(
printf("PRESS [S] FOR SEQUENTIAL VIEWING OF ROOM STATUS\n\nPRESS [V] FOR SINGULAR VIEWING OF ROOM STATUS\n\n");
vselection
vselection
int k;
for( k=0;k<4;k++)
{
}
switch(
{//Vselection Switch Begin
case 'S':{//Vselection Case S Begin
case 'V':{// Vselection case R Start
}// Falsified Limit End
} // Vselection Switch End
} // Data View Function End
//alter Function
void alter(void)//call alter function
{
system("cls");
system("color 0f");
for(
printf(
for(
printf(
printf("ENTER ROOM NUMBER TO BE ALTERED\n");
gets(temp);
rno=
// Room Number Limit Check
if(rno<1 || rno >30)
{//IF Condition Begin
mainm();
} //IF Condition End
else
{ // Limit Else Falsified Begin
int k;
for( k=0;k<5;k++)
{
}
{//rc Switch Begin
} // Limit Else Falsified End
} //alter Function End
//call Delete Function
void delet(void)
{
system("cls");
system("color 0f");
for(
printf(
for(
printf(
printf("ENTER ROOM NUMBER TO VACATE\n");
gets(temp);
rno=
// Room Number Limit Check
if(rno<1 || rno >30)
{//IF Condition Begin
mainm();
} //IF Condition End
else
{// Room Number Limit Falsified Else
}// Room Number Falsified Else End
}
void checkout(void)
{
//rate initializations
days=0;
hrate=0;
hbill=0;
system("cls");
system("color 0f");
for(
printf(
for(
printf(
printf("ENTER ROOM NUMBER CHECKING OUT\n");
gets(temp);
rno=
// Room Number Limit Check
if(rno<1 || rno >30)
{//IF Condition Begin
mainm();
} //IF Condition End
else
{ // Limit Else Falsified Begin
{//rc Switch Begin
} // Limit Else Falsified End
} //alter Function End
void guestlist(void)
{
system("cls");
system("color 0f");
for(
printf(
for(
printf(
printf(
rselection
rselection
int k;
for( k=0;k<2;k++)
{
}
switch(
{
void exiting(void)
{
int k;
for(
{
}
exit(0);
}
void passkey(void)
{
int k, p; // local declarations
char pass[5], *word = "king";
{
{
}//end of passkey function
void error(void)
{
int k;
for( k=0;k<4;k++) //to clear screen for for times
{ //blinking an errror warning message
}
}
my password is accepting anything instead of qqqq and need modification on the program for the better
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- 2012-11-14
- Last reply:
- 2012-11-14
shumai nyagura (shumain) said : | #1 |
how can i add a map to this program
Map in what sense?
Manfred Hampl (m-hampl) said : | #3 |
It seems to me that the comparison of the two passwords is wrong.
as far as I know strcmpi returns 0 if the two strings are identical, see http://
so I guess the passkey part of your program must be something like
if(strcmpi(
{
system("cls");
system("color 0a");
printf(
mainm();
}
else
{
system("cls");
system("color 0c");
printf(
}
exiting();
And by the way, you are displaying on screen that the right password is "qqqq", but in the passkey function you are validating against "king".
Warren Hill (warren-hill) said : | #4 |
What are you trying to do? What do you mean by map?
shumai nyagura (shumain) said : | #5 |
map for showing local directions
Warren Hill (warren-hill) said : | #6 |
There are a few options here
1. Use lots of printf calls and do a crude Map in ASCII art
2. Don't have map in the program but create one as a pdf in another program such as inkscape or gimp.
3. Learn how to draw graphics. There are plenty of programming tutorials around.
Warren Hill (warren-hill) said : | #7 |
Can you help with this problem?
Provide an answer of your own, or ask shumai nyagura for more information if necessary.