SlideShare une entreprise Scribd logo
1  sur  48
#include<iostream.h>

#include<graphics.h>

#include<conio.h>

#include<string.h>

#include<process.h>

#include<math.h>

#include<stdio.h>

#include<dos.h>



void wel(),gd(),bdr(),crux(),sparks(),ext(),pswrd();

void chkmn(),adm(),gst(),edtmn(),delmn(),srch();

void dtin(int),dtdis(int),dslst(),edit(),del(),src(),srn();



void chk(char &demo);

struct cust

{

       char nm[25],to[20],frm[20],mod[20],add[50];

       long pn,mn;

       int na,nc,cd;

};

cust c[5];

char usnm[10];

char ad[7]="Prachi0";


                                                              1
int csn=0;

int srr,ssr,dc,ec;



void swap(char *,char *);

void date();

int leap(int);

struct dat

{

       int d,m,y,lp;

};

dat dt;

int md[12]={31,28,31,30,31,30,31,31,30,31,30,31};



void time();

void distm();

void tmchg();

struct tim

{

       int h,m,s,t;

       char tt[5],x[5];

};

tim tm;

char ta[5]="A.M.0",tb[5]="P.M.0";


                                                    2
void main()

{

     clrscr();

     //wel();

     adm();

     getch();



}

void chkmn()

{

     int g=0;

     clrscr();

     sparks();

     bdr();

     gotoxy(10,40);

     cout<<"Press ESC to Exit the Program ";

     if(kbhit()==8)

     {

              gotoxy(15,45);

              cout<<"Terminating Program..........";

              delay(1000);

              exit(0);


                                                       3
}

     gotoxy(15,30);

     textcolor(LIGHTRED);

     cprintf("Enter your Name : ");

     gets(usnm);

     gotoxy(5,43);

     g=strcmpi(usnm,ad);

     if(g==0)

     {

             pswrd();

     }

     if(g!=0)

     {

             gst();

     }

}

void adm()

{

     gotoxy(6,6);

     int ch;



     while(1)

     {


                                      4
clrscr();

          gd();

          gotoxy(20,6);

          textcolor(LIGHTBLUE);

          cprintf("ADMINISTRATER MENU");

          gotoxy(8,9);

cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~"

                  <<"nnt1. Displays the list & details of all Travellers."

                  <<"nnt2. Go to the Guest Menu."

                  <<"nnt3. Searches the Traveller."

                  <<"nnt4. Edits the Traveller's Details."

                  <<"nnt5. Deletes the Traveller's Details."

                  <<"nnt6. Go to User Menu"

                  <<"nnt7. Exits the Program."

                  <<"nnntt Your choice : ";

          cin>>ch;

          switch(ch)

          {

                  case 1 :

                         dslst();

                         break;

                  case 2 :

                         gst();

                                                                                5
break;

                       case 3 :

                             srch();

                             break;

                       case 4 :

                             edtmn();

                             break;

                       case 5 :

                             delmn();

                             break;

                       case 6 :

                             chkmn();

                             break;

                       case 7 :

                             exit(0);

                       default :

                             cout<<" Wrong choice entered !!!!! " ;

                 }

                 getch();

        }

    //getch();

}

void srch()


                                                                      6
{

    int ch;



    while(1)

    {

          clrscr();

          cout<<"nnttSEARCH MENU"

                 <<"nnnt1. Search by Code."

                 <<"nnt2. Search by Name."

                 <<"nnt3. Go back to Administrator Menu."

                 <<"nnt4. Exit the Program."

                 <<"nnnttYour choice : ";

          cin>>ch;

          switch(ch)

          {

                 case 1 :

                       src();

                       break;

                 case 2 :

                       srn();

                       break;

                 case 3 :

                       adm();


                                                               7
break;

                     case 4 :

                            exit(0);

                     default :

                            cout<<"nnntt Wrong choice entered !!!!! " ;

             }

      }//getch();

      //getch();

}

void gst()

{

      int ch,flag=0;

      while(1)

      {

             clrscr();

             gd();

             gotoxy(20,6);

             textcolor(LIGHTBLUE);

             cprintf("GUEST MENU");

             gotoxy(8,9);


      cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~"

                     <<"nnt1. Accepts the details."

                                                                               8
<<"nnt2. Displays the details."

      <<"nnt3. Go to User Menu."

      <<"nnt4. Exits the Program"

      <<"nnntt Your choice : ";

cin>>ch;

switch(ch)

{

      case 1 :

             csn++;

             dtin(csn);

             flag=1;

             break;

      case 2 :

             if(flag)

             {

                    dtdis(csn-1);

                    break;

             }

             else

             {

                    cout<<"nnnttEnter choice 1 first !!!!!";

                    break;

             }


                                                                    9
case 3 :

                        chkmn();

                        break;



                  case 4 :

                        exit(0);

                  default :

                        cout<<"nnnt Wrong choice entered !!!!! " ;

           }

           if(ch==10)

                  adm();

           getch();

     }

}



void delmn()

{

     int ch;

     while(1)

     {

           clrscr();

           gotoxy(20,8);

           cout<<" DELETE MENU ";


                                                                         10
gotoxy(8,10);


      cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~"

                 <<"nntSearches & Deletes"

                 <<"nntt1. By Code "

                 <<"nntt2. By Name"

                 <<"nnt3. Go to Administrator Menu."

                 <<"nnt4. Exits the Program"

                 <<"nnntt Your choice : ";

           cin>>ch;

           switch(ch)

           {

                 case 1 :

                        dc=1;

                        del();

                        break;

                 case 2 :

                        dc=2;

                        del();

                        break;

                 case 3 :

                        adm();

                        break;

                                                                11
case 4 :

                         exit(0);

                   default :

                         cout<<"nnnt Wrong choice entered !!!!! " ;

            }

            getch();

      }

}




void edtmn()

{

      int ch;

      while(1)

      {

            clrscr();

            gotoxy(20,8);

            cout<<" EDIT MENU ";

            gotoxy(8,10);


      cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~"

                   <<"nntSearches & Edits"

                   <<"nntt1. By Code "

                                                                          12
<<"nntt2. By Name"

      <<"nnt3. Go to Administrator Menu."

      <<"nnt4. Exits the Program"

      <<"nnntt Your choice : ";

cin>>ch;

switch(ch)

{

      case 1 :

             ec=1;

             edit();

             break;

      case 2 :

             ec=2;

             edit();

             break;

      case 3 :

             adm();

             break;

      case 4 :

             exit(0);

      default :

             cout<<"nnnt Wrong choice entered !!!!! " ;

}


                                                              13
getch();

      }

}

void dtin(int l)

{

      l=l-1;

      clrscr();

      c[l].cd=2010+csn;

      textcolor(MAGENTA);

      gotoxy(20,8);

      cprintf("INPUTS TRAVELLERS DETAILS ");

      textcolor(LIGHTBLUE);

      gotoxy(18,10);

      cprintf("Customer Code. ");

      cout<<c[l].cd;

      gotoxy(7,15);

      cout<<"Name              : ";

      gets(c[l].nm);

      gotoxy(7,17);

      cout<<"From             : ";

      gets(c[l].frm);

      gotoxy(7,19);

      cout<<"Destination         : ";


                                               14
gets(c[l].to);

      gotoxy(7,21);

      cout<<"Address           : ";

      gets(c[l].add);

      gotoxy(7,23);

      cout<<"Mode of Transport : ";

      gets(c[l].mod);

      gotoxy(7,25);

      cout<<"Phone No.          : ";

      cin>>c[l].pn;

      gotoxy(7,27);

      cout<<"Mobile No.          : ";

      cin>>c[l].mn;

      gotoxy(7,29);

      cout<<"No. of adults       : ";

      cin>>c[l].na;

      gotoxy(7,31);

      cout<<"No. of children      : ";

      cin>>c[l].nc;

}

void dtdis(int l)

{

      clrscr();


                                         15
textcolor(MAGENTA);

gotoxy(20,8);

cprintf("TRAVELLER'S DETAILS ");

textcolor(LIGHTBLUE);

gotoxy(18,10);

cprintf("Customer Code. ");

cout<<c[l].cd;

gotoxy(7,15);

cout<<"Name             : ";

puts(c[l].nm);

gotoxy(7,17);

cout<<"From           : ";

puts(c[l].frm);

gotoxy(7,19);

cout<<"Destination        : ";

puts(c[l].to);

gotoxy(7,21);

cout<<"Address          : ";

puts(c[l].add);

gotoxy(7,23);

cout<<"Mode of Transport : ";

puts(c[l].mod);

gotoxy(7,25);


                                   16
cout<<"Phone No.            :"

               <<c[l].pn;

      gotoxy(7,27);

      cout<<"Mobile No.           :"

               <<c[l].mn;

      gotoxy(7,29);

      cout<<"No. of adults        :"

               <<c[l].na;

      gotoxy(7,31);

      cout<<"No. of children        :"

               <<c[l].nc;

}

void dslst()

{

      clrscr();

      int h=10;

      gotoxy(20,7);

      cout<<"TRAVELLER'S LIST"

               <<"nn       Code"

               <<"          Name"

               <<"          Mode of Transport";

      for(int i=0;i<csn;i++,h++,h++)

      {


                                                  17
gotoxy(8,h);

             cout<<c[i].cd;

             gotoxy(20,h);

             puts(c[i].nm);

             gotoxy(35,h);

             puts(c[i].mod);

      }

      adm();

}

void src()

{

      int sc,flag=0;

      cout<<"nnttEnter the Code of the Traveller : ";

      cin>>sc;

      for(int i=0;i<csn;i++)

      {

             if(sc==c[i].cd)

             {

                   flag=1;

                   srr=i;

                   ssr=1;

                   dtdis(srr);

             }


                                                            18
}

                 if(flag==0)

                 {

                        cout<<"nntEntered code doesn't exist in the records
!!!";

                        ssr=0;

                 }

        getch();



}

void srn()

{

        char sn[25];

        int x,flag=0,h=0;

        cout<<"nnntEnter the Name of the Traveller : ";

        gets(sn);

        for(int i=0;i<csn;i++)

        {

                 x=strcmpi(c[i].nm,sn);

                 h=1;

            //   cout<<endl<<x<<endl;

                 if(x==0)

                 {

                        flag=1;

                                                                                 19
srr=i;

                        ssr=1;

                        dtdis(srr);

               }



        }

        if((flag==0&&x!=0)||h==0)

        {

               cout<<"nnntEntered Traveller doesn't exist in the records
!!!";

               ssr=0;

        }

        getch();



}

void del()

{

        clrscr();

        if(dc==1);

        {

               src();

        }

        if(dc==2);

        {

                                                                               20
srn();

      }

      if(ssr==1)

      {

            for(int i=srr;i<csn;i++)

            {

                     c[i].cd=c[i+1].cd;

                     strcpy(c[i].nm,c[i+1].nm);

                     strcpy(c[i].frm,c[i+1].frm);

                     strcpy(c[i].to,c[i+1].to);

                     strcpy(c[i].add,c[i+1].add);

                     strcpy(c[i].mod,c[i+1].mod);

                     c[i].pn=c[i+1].pn;

                     c[i].mn=c[i+1].mn;

                     c[i].na=c[i+1].na;

                     c[i].nc=c[i+1].nc;

            }

            csn--;

             cout<<"nnt Entered traveller's details have been deleted
sucessfully !!!";

      }

      if(ssr==0)

      {

            cout<<"nnntEntered traveller's details not Deleted !!!";

                                                                           21
}

      getch();

      delmn();

}

void edit()

{

      int e;

      clrscr();

      if(ec==1);

      {

               src();

      }

      if(ec==2);

      {

               srn();

      }

      if(ssr==1)

      {

               clrscr();

               textcolor(MAGENTA);

               gotoxy(20,8);

               cprintf("EDITS TRAVELLERS DETAILS ");

               textcolor(LIGHTBLUE);


                                                       22
gotoxy(18,10);

cprintf("Customer Code. ");

cout<<c[srr].cd;

gotoxy(7,15);

cout<<"Name               : ";

puts(c[srr].nm);

e=getch();

if(e==8)

{

      gotoxy(29,15);

      cout<<"                    ";

      gotoxy(29,15);

      gets(c[srr].nm);

}

gotoxy(7,17);

cout<<"From              : ";

puts(c[srr].frm);

e=getch();

if(e==8)

{

      gotoxy(29,17);

      cout<<"                    ";

      gotoxy(29,17);


                                      23
gets(c[srr].frm);

}

gotoxy(7,19);

cout<<"Destination         : ";

puts(c[srr].to);

e=getch();

if(e==8)

{

      gotoxy(29,19);

      cout<<"                     ";

      gotoxy(29,19);

      gets(c[srr].to);

}

gotoxy(7,21);

cout<<"Address            : ";

puts(c[srr].add);

e=getch();

if(e==8)

{

      gotoxy(29,21);

      cout<<"                     ";

      gotoxy(29,21);

      gets(c[srr].add);


                                       24
}

gotoxy(7,23);

cout<<"Mode of Transport : ";

puts(c[srr].mod);

e=getch();

if(e==8)

{

      gotoxy(29,23);

      cout<<"                    ";

      gotoxy(29,23);

      gets(c[srr].mod);

}

gotoxy(7,25);

cout<<"Phone No.          : ";

cout<<c[srr].pn;

e=getch();

if(e==8)

{

      gotoxy(29,25);

      cout<<"                    ";

      gotoxy(29,25);

      cin>>c[srr].pn;

}


                                      25
gotoxy(7,27);

cout<<"Mobile No.       : ";

cout<<c[srr].mn;

e=getch();

if(e==8)

{

      gotoxy(29,27);

      cout<<"                  ";

      gotoxy(29,27);

      cin>>c[srr].mn;

}

gotoxy(7,29);

cout<<"No. of adults    : ";

cout<<c[srr].na;

e=getch();

if(e==8)

{

      gotoxy(29,29);

      cout<<"                       ";

      gotoxy(29,29);

      cin>>c[srr].na;

}

gotoxy(7,31);


                                         26
cout<<"No. of children    : ";

             cout<<c[srr].nc;

             e=getch();

             if(e==8)

             {

                   gotoxy(29,31);

                   cout<<"                           ";

                   gotoxy(29,31);

                   cin>>c[srr].nc;

             }

             cout<<"nnt Entered traveller's details have been edited
sucessfully !!!";

      }

      if(ssr==0)

      {

                   cout<<"nnntEntered traveller's details not Edited !!!";

      }

      getch();

      edtmn();

}

void pswrd()

{

      clrscr();



                                                                             27
gd();

     char pass[10],abs[10]="money";

     char pp[3]={1,2,'0'};

     int h,i,f,l;



         //   gotoxy(5,5);

     textcolor(LIGHTRED);

         //   cprintf("Enter the username : ");

         //   gets(us);




     for(int s=1;s<=3;s++)

     {

              f=0;

              gotoxy(5,8);

                  //   textcolor(LIGHTBLUE);

              cprintf("Enter the Password :       ");

x:

              h=26;

              for(i=0;i>=0;i++,h++)

              {

s:

                       gotoxy(h,8);


                                                        28
pass[i]=getch();

    //b++;



    if(pass[i]==13)

    {

          break;

    }



    if(pass[i]==8)

    {

          h--;

          if(h<26)

          {

                 goto x;

          }

          gotoxy(h,8);

          cout<<" ";

          i--;

          pass[i]=NULL;

          goto s;

    }

    cout<<"*";

}


                           29
pass[i]=NULL;

        l=strlen(pass);



        cout<<"nn";



        f=strcmp(pass,abs);



        if(f==0)

        {

              textcolor(LIGHTBLUE);

              cprintf("nnn             Entered correct password !!!!!!!!
n");

              gotoxy(3,16);

              textcolor(YELLOW);

              cprintf("nProgram in process please wait....nnnn");

              for(int j=0,k=0;j<50;k=k+2,j++)

              {

                     gotoxy(5,20);

                     textcolor(GREEN);

                     cprintf(" Done ");

                     cout<<k+2<<" % ";

                     gotoxy(10+j,22);

                     textcolor(MAGENTA);

                                                                              30
cprintf(pp);

                              delay(200);

                     }

                     adm();

                     break;

              }

              else if(f!=0)

              {

                     textcolor(CYAN);

                     cprintf("nnn Wrong password entered !!!! Re-enter
Password......");

                     //b++;

                     for( i=0;i<l;i++,h--)

                     {

                              pass[i]=NULL;

                              gotoxy(h-1,8);

                              cout<<" ";

                     }

                     if(s==3)

                     {

                              gotoxy(2,18);

                              textcolor(RED);

                              cprintf("You have entered the password wrong 3
times.. ");

                                                                               31
gotoxy(2,20);

                        cprintf("Now your program has been blocked !!!!");

                   }

               }

      }

      cout<<"nnnn";

      getch();



}

void wel()

{

      clrscr();

      textcolor(YELLOW);

      gotoxy(28,15);

      cprintf("WELCOME TO SPARKS TRAVELS ");

      gotoxy(40,35);

      textcolor(LIGHTBLUE);

      cprintf("Developed By - ");

      textcolor(BLUE+BLINK);

      cprintf("Parimal Chakole,DVS Srihari,Naina Ghate");

      gd();

      ext();

      delay(1000);


                                                                         32
chkmn();

}

void gd()

{

      //textbackground(WHITE);

      textcolor(RED);

      for(int i=1;i<80;i++)   //outer hori.

      {

            gotoxy(i,1);

            cprintf("*");

            gotoxy(i,50);

            cprintf("*");

      }

      textcolor(GREEN+BLINK);

      for(i=3;i<78;i++)       // inner hori.

      {

            gotoxy(i,2);

            cprintf(".");

            gotoxy(i,48);

            cprintf(".");



      }

      textcolor(RED);


                                               33
for(int j=1;j<50;j++)    // outer vert.

      {

             gotoxy(1,j);

             cprintf("*");

             gotoxy(80,j);

             cprintf("*");

      }

      textcolor(GREEN+BLINK);

      for(j=2;j<48;j++)       // inner vert.

      {

             gotoxy(3,j);

             cprintf(".");

             gotoxy(78,j);

             cprintf(".");

      }

      gotoxy(5,5);

}

void bdr()

{

      textcolor(GREEN+BLINK);

      for(int i=1;i<80;i++)   //outer hori.

      {

             gotoxy(i,1);


                                                34
cprintf("@");

      gotoxy(i,50);

      cprintf("@");

}

textcolor(RED);

for(i=3;i<78;i++)       // inner hori.

{

      gotoxy(i,2);

      cprintf(".");

      gotoxy(i,48);

      cprintf(".");



}

textcolor(GREEN+BLINK);

for(int j=1;j<50;j++)    // outer vert.

{

      gotoxy(1,j);

      cprintf("@");

      gotoxy(80,j);

      cprintf("@");

}

textcolor(RED);

for(j=2;j<48;j++)       // inner vert.


                                          35
{

               gotoxy(3,j);

               cprintf(".");

               gotoxy(78,j);

               cprintf(".");

      }

      gotoxy(5,5);

}

void crux()

{

          //   clrscr();

      textcolor(RED+BLUE);

      cprintf("                $$$$ $$$$ $ $ $ $"); cout<<endl;

      cprintf("               $   $ $ $ $ $ $ ");        cout<<endl;

      cprintf("               $   $$$$ $ $ $$ ");        cout<<endl;

      cprintf("               $   $ $$ $ $ $ $ ");       cout<<endl;

      cprintf("                $$$$ $ $ $$$ $ $"); cout<<"nnnn";



      cprintf("       $$$$$$$ $$$$ $$$ $ $ $$$$$ $             $$$$"); cout<<endl;

      cprintf("            $ $ $$ $$ $$       $       $$ ");    cout<<endl;

      cprintf("            $ $$$$ $$$$$ $ $ $$$ $         $$$ ");      cout<<endl;

      cprintf("            $ $ $$ $ $ $ $ $       $      $$"); cout<<endl;

      cprintf("            $ $ $ $ $ $ $$$$$ $$$$$ $$$$ ");


                                                                                     36
}

void sparks()

{

        //     clrscr();

      textcolor(RED+BLUE);

      gotoxy(1,7);

      cprintf("              $$$$ $$$$ $$$ $$$$ $ $ $$$$ "); cout<<endl;

      cprintf("             $$ $ $ $ $ $ $ $ $ $$ "); cout<<endl;

      cprintf("              $$$ $$$$ $$$$$ $$$$ $$$ $$$ ");cout<<endl;

      cprintf("               $$ $   $ $ $ $$ $ $   $$ "); cout<<endl;

      cprintf("             $$$$ $    $ $ $ $ $ $ $$$$ "); cout<<"nnnn";



     cprintf("             $$$$$$$ $$$$ $$$ $ $ $$$$$ $       $$$$");
cout<<endl;

      cprintf("             $ $ $$ $$ $$       $    $$ ");      cout<<endl;

      cprintf("             $ $$$$ $$$$$ $ $ $$$ $       $$$ "); cout<<endl;

      cprintf("             $ $ $$ $ $ $ $ $    $     $$");     cout<<endl;

      cprintf("             $ $ $ $ $ $ $$$$$ $$$$$ $$$$ ");

}



void ext()

{

      int k;

      gotoxy(5,43);

                                                                               37
cout<<"Press ESC to Exit the Program ";

      k=getch();

      if(k==27)

      {

              gotoxy(20,45);

              cout<<"Terminating Program..........";

              delay(1000);

              exit(0);

      }

}



void date()

{

      cout<<"Enter the year : ";

      cin>>dt.y;

      while(dt.y<=999||dt.y>1)

      {

              cout<<"Invalid year re-enter : ";

              cin>>dt.y;

      }

      dt.lp=leap(dt.y);



      cout<<"Enter t ";


                                                       38
cin>>dt.m;

      while(dt.m<1||dt.m>12)

      {

             cout<<"Invalid year re-enter : ";

             cin>>dt.m;

      }



      cout<<"Enter the date : ";

      cin>>dt.d;

      while(dt.d>md[dt.m-1]||dt.d<1)

      {

             cout<<"Invalid date re-enter : ";

             cin>>dt.d;

      }



}

int leap(int x)

{

      int lp=0;

      if((x%4==0)||((x%400==0)&&(x%100==0)))

      {

             lp=1;

             md[2]=28;


                                                 39
}

      return lp;

}



void time()

{

      cout<<"Enter hours : ";

      cin>>tm.h;

      while(tm.h>12)

      {

              cout<<"Invalid hours re-enter : ";

              cin>>tm.h;

      }



      cout<<"Enter minutes : ";

      cin>>tm.m;

      while(tm.m>60)

      {

              cout<<"Invalid minutes re-enter : ";

              cin>>tm.m;

      }

      cout<<"Enter seconds : ";

      cin>>tm.s;


                                                     40
while(tm.s>60)

     {

           cout<<"Invalid seconds re-enter : ";

           cin>>tm.s;

     }

     cout<<"nIs it A.M. or P.M. ??"

           <<"nEnter 1. A.M."

           <<"nEnter 2. P.M."

           <<"nnYour choice : ";

     cin>>tm.t;

     while(tm.t!=1&&tm.t!=2)

     {

           cout<<"Invalid time re-enter : ";

           cin>>tm.t;

     }

     if(tm.t==1)

     {

           strcpy(tm.tt,ta);

//         puts(tb);

           strcpy(tm.x,tb);

     }

     if(tm.t==2)

     {


                                                  41
strcpy(tm.tt,tb);

    //          puts(ta);

                strcpy(tm.x,ta);

         }

         tm.tt[4]='0';

         tm.x[4]='0';

         distm();

         tmchg();

}



void distm()

{

         gotoxy(15,15);

         cprintf(" ");

         cout<<tm.h<<":"

                <<tm.m<<":"

                <<tm.s<<" "

                <<tm.tt;

}

void tmchg()

{

         for(int a=tm.h;a<=12;a++)

         {


                                     42
for(int b=tm.m;b<60;b++)

{

     for(int c=tm.s;c<=60;c++)

     {

           delay(1003);

      //   gotoxy(15,15);

           distm();

           tm.s++;

           if(kbhit())

           {

                  delay(500);

                  gotoxy(7,25);

                  cout<<"Time Stopped !!!!";

                  delay(1000);

                  cout<<"Terminating.......";

                  delay(2000);

           }

           if(tm.h==12&&tm.m==59&&tm.s==60)

           {

                  tm.h=1;

                  a=1;

                  tm.m=0;

                  b=0;


                                                43
tm.s=0;

                                  c=0;

                                  swap(tm.tt,tm.x);

                          }

                     }

                     tm.m++;

                     tm.s=00;

            }

            tm.h++;

            tm.m=00;

      }

}

void swap(char a[5], char b[5])

{

      char c[5];

      strcpy(c,a);

      strcpy(a,b);

      strcpy(b,c);

}




                                                      44
45
46
47
48

Contenu connexe

Tendances (20)

DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDYDATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
 
Ss
SsSs
Ss
 
Cquestions
Cquestions Cquestions
Cquestions
 
Static and const members
Static and const membersStatic and const members
Static and const members
 
Student Data Base Using C/C++ Final Project
Student Data Base Using C/C++ Final ProjectStudent Data Base Using C/C++ Final Project
Student Data Base Using C/C++ Final Project
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
 
C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
Inheritance and polymorphism
Inheritance and polymorphismInheritance and polymorphism
Inheritance and polymorphism
 
New presentation oop
New presentation oopNew presentation oop
New presentation oop
 
Binomial heap
Binomial heapBinomial heap
Binomial heap
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semester
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Ds 2 cycle
Ds 2 cycleDs 2 cycle
Ds 2 cycle
 
Double linked list
Double linked listDouble linked list
Double linked list
 
Network lab manual
Network lab manualNetwork lab manual
Network lab manual
 
C++ TUTORIAL 9
C++ TUTORIAL 9C++ TUTORIAL 9
C++ TUTORIAL 9
 
Opp compile
Opp compileOpp compile
Opp compile
 
C++ TUTORIAL 10
C++ TUTORIAL 10C++ TUTORIAL 10
C++ TUTORIAL 10
 
Implementing string
Implementing stringImplementing string
Implementing string
 
Double linked list
Double linked listDouble linked list
Double linked list
 

En vedette

En vedette (7)

Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pointers & References in C++
Pointers & References in C++Pointers & References in C++
Pointers & References in C++
 
C pointer basics
C pointer basicsC pointer basics
C pointer basics
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual
 

Similaire à Travel management

Programming - Marla Fuentes
Programming - Marla FuentesProgramming - Marla Fuentes
Programming - Marla Fuentesmfuentessss
 
Final requirement in programming niperos
Final requirement in programming   niperosFinal requirement in programming   niperos
Final requirement in programming niperosmarkings17
 
Chainer-Compiler 動かしてみた
Chainer-Compiler 動かしてみたChainer-Compiler 動かしてみた
Chainer-Compiler 動かしてみたAkira Maruoka
 
Basic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python ProgrammersBasic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python ProgrammersAppier
 
HDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdfHDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdfkaarthikK6
 
Programación de C++, Función Case
Programación de C++, Función CaseProgramación de C++, Función Case
Programación de C++, Función CaseRamon Lop-Mi
 
Apache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheelApache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheeltcurdt
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기Ji Hun Kim
 
Zarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDIZarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDIKonrad Kokosa
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxSANTIAGO PABLO ALBERTO
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersJen Yee Hong
 

Similaire à Travel management (20)

C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data typeC program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
 
Programming - Marla Fuentes
Programming - Marla FuentesProgramming - Marla Fuentes
Programming - Marla Fuentes
 
Marat-Slides
Marat-SlidesMarat-Slides
Marat-Slides
 
3
33
3
 
Vcs8
Vcs8Vcs8
Vcs8
 
Final requirement in programming niperos
Final requirement in programming   niperosFinal requirement in programming   niperos
Final requirement in programming niperos
 
Chainer-Compiler 動かしてみた
Chainer-Compiler 動かしてみたChainer-Compiler 動かしてみた
Chainer-Compiler 動かしてみた
 
Exception handling
Exception handlingException handling
Exception handling
 
DataTypes.ppt
DataTypes.pptDataTypes.ppt
DataTypes.ppt
 
Basic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python ProgrammersBasic C++ 11/14 for Python Programmers
Basic C++ 11/14 for Python Programmers
 
HDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdfHDL PROGRAMMING-3.pdf
HDL PROGRAMMING-3.pdf
 
Programación de C++, Función Case
Programación de C++, Función CaseProgramación de C++, Función Case
Programación de C++, Función Case
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
Apache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheelApache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheel
 
Project in programming
Project in programmingProject in programming
Project in programming
 
Presentation1
Presentation1Presentation1
Presentation1
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
Zarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDIZarzadzanie pamiecia w .NET - WDI
Zarzadzanie pamiecia w .NET - WDI
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
Basic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmersBasic c++ 11/14 for python programmers
Basic c++ 11/14 for python programmers
 

Dernier

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 

Dernier (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 

Travel management

  • 1. #include<iostream.h> #include<graphics.h> #include<conio.h> #include<string.h> #include<process.h> #include<math.h> #include<stdio.h> #include<dos.h> void wel(),gd(),bdr(),crux(),sparks(),ext(),pswrd(); void chkmn(),adm(),gst(),edtmn(),delmn(),srch(); void dtin(int),dtdis(int),dslst(),edit(),del(),src(),srn(); void chk(char &demo); struct cust { char nm[25],to[20],frm[20],mod[20],add[50]; long pn,mn; int na,nc,cd; }; cust c[5]; char usnm[10]; char ad[7]="Prachi0"; 1
  • 2. int csn=0; int srr,ssr,dc,ec; void swap(char *,char *); void date(); int leap(int); struct dat { int d,m,y,lp; }; dat dt; int md[12]={31,28,31,30,31,30,31,31,30,31,30,31}; void time(); void distm(); void tmchg(); struct tim { int h,m,s,t; char tt[5],x[5]; }; tim tm; char ta[5]="A.M.0",tb[5]="P.M.0"; 2
  • 3. void main() { clrscr(); //wel(); adm(); getch(); } void chkmn() { int g=0; clrscr(); sparks(); bdr(); gotoxy(10,40); cout<<"Press ESC to Exit the Program "; if(kbhit()==8) { gotoxy(15,45); cout<<"Terminating Program.........."; delay(1000); exit(0); 3
  • 4. } gotoxy(15,30); textcolor(LIGHTRED); cprintf("Enter your Name : "); gets(usnm); gotoxy(5,43); g=strcmpi(usnm,ad); if(g==0) { pswrd(); } if(g!=0) { gst(); } } void adm() { gotoxy(6,6); int ch; while(1) { 4
  • 5. clrscr(); gd(); gotoxy(20,6); textcolor(LIGHTBLUE); cprintf("ADMINISTRATER MENU"); gotoxy(8,9); cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~" <<"nnt1. Displays the list & details of all Travellers." <<"nnt2. Go to the Guest Menu." <<"nnt3. Searches the Traveller." <<"nnt4. Edits the Traveller's Details." <<"nnt5. Deletes the Traveller's Details." <<"nnt6. Go to User Menu" <<"nnt7. Exits the Program." <<"nnntt Your choice : "; cin>>ch; switch(ch) { case 1 : dslst(); break; case 2 : gst(); 5
  • 6. break; case 3 : srch(); break; case 4 : edtmn(); break; case 5 : delmn(); break; case 6 : chkmn(); break; case 7 : exit(0); default : cout<<" Wrong choice entered !!!!! " ; } getch(); } //getch(); } void srch() 6
  • 7. { int ch; while(1) { clrscr(); cout<<"nnttSEARCH MENU" <<"nnnt1. Search by Code." <<"nnt2. Search by Name." <<"nnt3. Go back to Administrator Menu." <<"nnt4. Exit the Program." <<"nnnttYour choice : "; cin>>ch; switch(ch) { case 1 : src(); break; case 2 : srn(); break; case 3 : adm(); 7
  • 8. break; case 4 : exit(0); default : cout<<"nnntt Wrong choice entered !!!!! " ; } }//getch(); //getch(); } void gst() { int ch,flag=0; while(1) { clrscr(); gd(); gotoxy(20,6); textcolor(LIGHTBLUE); cprintf("GUEST MENU"); gotoxy(8,9); cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~" <<"nnt1. Accepts the details." 8
  • 9. <<"nnt2. Displays the details." <<"nnt3. Go to User Menu." <<"nnt4. Exits the Program" <<"nnntt Your choice : "; cin>>ch; switch(ch) { case 1 : csn++; dtin(csn); flag=1; break; case 2 : if(flag) { dtdis(csn-1); break; } else { cout<<"nnnttEnter choice 1 first !!!!!"; break; } 9
  • 10. case 3 : chkmn(); break; case 4 : exit(0); default : cout<<"nnnt Wrong choice entered !!!!! " ; } if(ch==10) adm(); getch(); } } void delmn() { int ch; while(1) { clrscr(); gotoxy(20,8); cout<<" DELETE MENU "; 10
  • 11. gotoxy(8,10); cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~" <<"nntSearches & Deletes" <<"nntt1. By Code " <<"nntt2. By Name" <<"nnt3. Go to Administrator Menu." <<"nnt4. Exits the Program" <<"nnntt Your choice : "; cin>>ch; switch(ch) { case 1 : dc=1; del(); break; case 2 : dc=2; del(); break; case 3 : adm(); break; 11
  • 12. case 4 : exit(0); default : cout<<"nnnt Wrong choice entered !!!!! " ; } getch(); } } void edtmn() { int ch; while(1) { clrscr(); gotoxy(20,8); cout<<" EDIT MENU "; gotoxy(8,10); cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~" <<"nntSearches & Edits" <<"nntt1. By Code " 12
  • 13. <<"nntt2. By Name" <<"nnt3. Go to Administrator Menu." <<"nnt4. Exits the Program" <<"nnntt Your choice : "; cin>>ch; switch(ch) { case 1 : ec=1; edit(); break; case 2 : ec=2; edit(); break; case 3 : adm(); break; case 4 : exit(0); default : cout<<"nnnt Wrong choice entered !!!!! " ; } 13
  • 14. getch(); } } void dtin(int l) { l=l-1; clrscr(); c[l].cd=2010+csn; textcolor(MAGENTA); gotoxy(20,8); cprintf("INPUTS TRAVELLERS DETAILS "); textcolor(LIGHTBLUE); gotoxy(18,10); cprintf("Customer Code. "); cout<<c[l].cd; gotoxy(7,15); cout<<"Name : "; gets(c[l].nm); gotoxy(7,17); cout<<"From : "; gets(c[l].frm); gotoxy(7,19); cout<<"Destination : "; 14
  • 15. gets(c[l].to); gotoxy(7,21); cout<<"Address : "; gets(c[l].add); gotoxy(7,23); cout<<"Mode of Transport : "; gets(c[l].mod); gotoxy(7,25); cout<<"Phone No. : "; cin>>c[l].pn; gotoxy(7,27); cout<<"Mobile No. : "; cin>>c[l].mn; gotoxy(7,29); cout<<"No. of adults : "; cin>>c[l].na; gotoxy(7,31); cout<<"No. of children : "; cin>>c[l].nc; } void dtdis(int l) { clrscr(); 15
  • 16. textcolor(MAGENTA); gotoxy(20,8); cprintf("TRAVELLER'S DETAILS "); textcolor(LIGHTBLUE); gotoxy(18,10); cprintf("Customer Code. "); cout<<c[l].cd; gotoxy(7,15); cout<<"Name : "; puts(c[l].nm); gotoxy(7,17); cout<<"From : "; puts(c[l].frm); gotoxy(7,19); cout<<"Destination : "; puts(c[l].to); gotoxy(7,21); cout<<"Address : "; puts(c[l].add); gotoxy(7,23); cout<<"Mode of Transport : "; puts(c[l].mod); gotoxy(7,25); 16
  • 17. cout<<"Phone No. :" <<c[l].pn; gotoxy(7,27); cout<<"Mobile No. :" <<c[l].mn; gotoxy(7,29); cout<<"No. of adults :" <<c[l].na; gotoxy(7,31); cout<<"No. of children :" <<c[l].nc; } void dslst() { clrscr(); int h=10; gotoxy(20,7); cout<<"TRAVELLER'S LIST" <<"nn Code" <<" Name" <<" Mode of Transport"; for(int i=0;i<csn;i++,h++,h++) { 17
  • 18. gotoxy(8,h); cout<<c[i].cd; gotoxy(20,h); puts(c[i].nm); gotoxy(35,h); puts(c[i].mod); } adm(); } void src() { int sc,flag=0; cout<<"nnttEnter the Code of the Traveller : "; cin>>sc; for(int i=0;i<csn;i++) { if(sc==c[i].cd) { flag=1; srr=i; ssr=1; dtdis(srr); } 18
  • 19. } if(flag==0) { cout<<"nntEntered code doesn't exist in the records !!!"; ssr=0; } getch(); } void srn() { char sn[25]; int x,flag=0,h=0; cout<<"nnntEnter the Name of the Traveller : "; gets(sn); for(int i=0;i<csn;i++) { x=strcmpi(c[i].nm,sn); h=1; // cout<<endl<<x<<endl; if(x==0) { flag=1; 19
  • 20. srr=i; ssr=1; dtdis(srr); } } if((flag==0&&x!=0)||h==0) { cout<<"nnntEntered Traveller doesn't exist in the records !!!"; ssr=0; } getch(); } void del() { clrscr(); if(dc==1); { src(); } if(dc==2); { 20
  • 21. srn(); } if(ssr==1) { for(int i=srr;i<csn;i++) { c[i].cd=c[i+1].cd; strcpy(c[i].nm,c[i+1].nm); strcpy(c[i].frm,c[i+1].frm); strcpy(c[i].to,c[i+1].to); strcpy(c[i].add,c[i+1].add); strcpy(c[i].mod,c[i+1].mod); c[i].pn=c[i+1].pn; c[i].mn=c[i+1].mn; c[i].na=c[i+1].na; c[i].nc=c[i+1].nc; } csn--; cout<<"nnt Entered traveller's details have been deleted sucessfully !!!"; } if(ssr==0) { cout<<"nnntEntered traveller's details not Deleted !!!"; 21
  • 22. } getch(); delmn(); } void edit() { int e; clrscr(); if(ec==1); { src(); } if(ec==2); { srn(); } if(ssr==1) { clrscr(); textcolor(MAGENTA); gotoxy(20,8); cprintf("EDITS TRAVELLERS DETAILS "); textcolor(LIGHTBLUE); 22
  • 23. gotoxy(18,10); cprintf("Customer Code. "); cout<<c[srr].cd; gotoxy(7,15); cout<<"Name : "; puts(c[srr].nm); e=getch(); if(e==8) { gotoxy(29,15); cout<<" "; gotoxy(29,15); gets(c[srr].nm); } gotoxy(7,17); cout<<"From : "; puts(c[srr].frm); e=getch(); if(e==8) { gotoxy(29,17); cout<<" "; gotoxy(29,17); 23
  • 24. gets(c[srr].frm); } gotoxy(7,19); cout<<"Destination : "; puts(c[srr].to); e=getch(); if(e==8) { gotoxy(29,19); cout<<" "; gotoxy(29,19); gets(c[srr].to); } gotoxy(7,21); cout<<"Address : "; puts(c[srr].add); e=getch(); if(e==8) { gotoxy(29,21); cout<<" "; gotoxy(29,21); gets(c[srr].add); 24
  • 25. } gotoxy(7,23); cout<<"Mode of Transport : "; puts(c[srr].mod); e=getch(); if(e==8) { gotoxy(29,23); cout<<" "; gotoxy(29,23); gets(c[srr].mod); } gotoxy(7,25); cout<<"Phone No. : "; cout<<c[srr].pn; e=getch(); if(e==8) { gotoxy(29,25); cout<<" "; gotoxy(29,25); cin>>c[srr].pn; } 25
  • 26. gotoxy(7,27); cout<<"Mobile No. : "; cout<<c[srr].mn; e=getch(); if(e==8) { gotoxy(29,27); cout<<" "; gotoxy(29,27); cin>>c[srr].mn; } gotoxy(7,29); cout<<"No. of adults : "; cout<<c[srr].na; e=getch(); if(e==8) { gotoxy(29,29); cout<<" "; gotoxy(29,29); cin>>c[srr].na; } gotoxy(7,31); 26
  • 27. cout<<"No. of children : "; cout<<c[srr].nc; e=getch(); if(e==8) { gotoxy(29,31); cout<<" "; gotoxy(29,31); cin>>c[srr].nc; } cout<<"nnt Entered traveller's details have been edited sucessfully !!!"; } if(ssr==0) { cout<<"nnntEntered traveller's details not Edited !!!"; } getch(); edtmn(); } void pswrd() { clrscr(); 27
  • 28. gd(); char pass[10],abs[10]="money"; char pp[3]={1,2,'0'}; int h,i,f,l; // gotoxy(5,5); textcolor(LIGHTRED); // cprintf("Enter the username : "); // gets(us); for(int s=1;s<=3;s++) { f=0; gotoxy(5,8); // textcolor(LIGHTBLUE); cprintf("Enter the Password : "); x: h=26; for(i=0;i>=0;i++,h++) { s: gotoxy(h,8); 28
  • 29. pass[i]=getch(); //b++; if(pass[i]==13) { break; } if(pass[i]==8) { h--; if(h<26) { goto x; } gotoxy(h,8); cout<<" "; i--; pass[i]=NULL; goto s; } cout<<"*"; } 29
  • 30. pass[i]=NULL; l=strlen(pass); cout<<"nn"; f=strcmp(pass,abs); if(f==0) { textcolor(LIGHTBLUE); cprintf("nnn Entered correct password !!!!!!!! n"); gotoxy(3,16); textcolor(YELLOW); cprintf("nProgram in process please wait....nnnn"); for(int j=0,k=0;j<50;k=k+2,j++) { gotoxy(5,20); textcolor(GREEN); cprintf(" Done "); cout<<k+2<<" % "; gotoxy(10+j,22); textcolor(MAGENTA); 30
  • 31. cprintf(pp); delay(200); } adm(); break; } else if(f!=0) { textcolor(CYAN); cprintf("nnn Wrong password entered !!!! Re-enter Password......"); //b++; for( i=0;i<l;i++,h--) { pass[i]=NULL; gotoxy(h-1,8); cout<<" "; } if(s==3) { gotoxy(2,18); textcolor(RED); cprintf("You have entered the password wrong 3 times.. "); 31
  • 32. gotoxy(2,20); cprintf("Now your program has been blocked !!!!"); } } } cout<<"nnnn"; getch(); } void wel() { clrscr(); textcolor(YELLOW); gotoxy(28,15); cprintf("WELCOME TO SPARKS TRAVELS "); gotoxy(40,35); textcolor(LIGHTBLUE); cprintf("Developed By - "); textcolor(BLUE+BLINK); cprintf("Parimal Chakole,DVS Srihari,Naina Ghate"); gd(); ext(); delay(1000); 32
  • 33. chkmn(); } void gd() { //textbackground(WHITE); textcolor(RED); for(int i=1;i<80;i++) //outer hori. { gotoxy(i,1); cprintf("*"); gotoxy(i,50); cprintf("*"); } textcolor(GREEN+BLINK); for(i=3;i<78;i++) // inner hori. { gotoxy(i,2); cprintf("."); gotoxy(i,48); cprintf("."); } textcolor(RED); 33
  • 34. for(int j=1;j<50;j++) // outer vert. { gotoxy(1,j); cprintf("*"); gotoxy(80,j); cprintf("*"); } textcolor(GREEN+BLINK); for(j=2;j<48;j++) // inner vert. { gotoxy(3,j); cprintf("."); gotoxy(78,j); cprintf("."); } gotoxy(5,5); } void bdr() { textcolor(GREEN+BLINK); for(int i=1;i<80;i++) //outer hori. { gotoxy(i,1); 34
  • 35. cprintf("@"); gotoxy(i,50); cprintf("@"); } textcolor(RED); for(i=3;i<78;i++) // inner hori. { gotoxy(i,2); cprintf("."); gotoxy(i,48); cprintf("."); } textcolor(GREEN+BLINK); for(int j=1;j<50;j++) // outer vert. { gotoxy(1,j); cprintf("@"); gotoxy(80,j); cprintf("@"); } textcolor(RED); for(j=2;j<48;j++) // inner vert. 35
  • 36. { gotoxy(3,j); cprintf("."); gotoxy(78,j); cprintf("."); } gotoxy(5,5); } void crux() { // clrscr(); textcolor(RED+BLUE); cprintf(" $$$$ $$$$ $ $ $ $"); cout<<endl; cprintf(" $ $ $ $ $ $ $ "); cout<<endl; cprintf(" $ $$$$ $ $ $$ "); cout<<endl; cprintf(" $ $ $$ $ $ $ $ "); cout<<endl; cprintf(" $$$$ $ $ $$$ $ $"); cout<<"nnnn"; cprintf(" $$$$$$$ $$$$ $$$ $ $ $$$$$ $ $$$$"); cout<<endl; cprintf(" $ $ $$ $$ $$ $ $$ "); cout<<endl; cprintf(" $ $$$$ $$$$$ $ $ $$$ $ $$$ "); cout<<endl; cprintf(" $ $ $$ $ $ $ $ $ $ $$"); cout<<endl; cprintf(" $ $ $ $ $ $ $$$$$ $$$$$ $$$$ "); 36
  • 37. } void sparks() { // clrscr(); textcolor(RED+BLUE); gotoxy(1,7); cprintf(" $$$$ $$$$ $$$ $$$$ $ $ $$$$ "); cout<<endl; cprintf(" $$ $ $ $ $ $ $ $ $ $$ "); cout<<endl; cprintf(" $$$ $$$$ $$$$$ $$$$ $$$ $$$ ");cout<<endl; cprintf(" $$ $ $ $ $ $$ $ $ $$ "); cout<<endl; cprintf(" $$$$ $ $ $ $ $ $ $ $$$$ "); cout<<"nnnn"; cprintf(" $$$$$$$ $$$$ $$$ $ $ $$$$$ $ $$$$"); cout<<endl; cprintf(" $ $ $$ $$ $$ $ $$ "); cout<<endl; cprintf(" $ $$$$ $$$$$ $ $ $$$ $ $$$ "); cout<<endl; cprintf(" $ $ $$ $ $ $ $ $ $ $$"); cout<<endl; cprintf(" $ $ $ $ $ $ $$$$$ $$$$$ $$$$ "); } void ext() { int k; gotoxy(5,43); 37
  • 38. cout<<"Press ESC to Exit the Program "; k=getch(); if(k==27) { gotoxy(20,45); cout<<"Terminating Program.........."; delay(1000); exit(0); } } void date() { cout<<"Enter the year : "; cin>>dt.y; while(dt.y<=999||dt.y>1) { cout<<"Invalid year re-enter : "; cin>>dt.y; } dt.lp=leap(dt.y); cout<<"Enter t "; 38
  • 39. cin>>dt.m; while(dt.m<1||dt.m>12) { cout<<"Invalid year re-enter : "; cin>>dt.m; } cout<<"Enter the date : "; cin>>dt.d; while(dt.d>md[dt.m-1]||dt.d<1) { cout<<"Invalid date re-enter : "; cin>>dt.d; } } int leap(int x) { int lp=0; if((x%4==0)||((x%400==0)&&(x%100==0))) { lp=1; md[2]=28; 39
  • 40. } return lp; } void time() { cout<<"Enter hours : "; cin>>tm.h; while(tm.h>12) { cout<<"Invalid hours re-enter : "; cin>>tm.h; } cout<<"Enter minutes : "; cin>>tm.m; while(tm.m>60) { cout<<"Invalid minutes re-enter : "; cin>>tm.m; } cout<<"Enter seconds : "; cin>>tm.s; 40
  • 41. while(tm.s>60) { cout<<"Invalid seconds re-enter : "; cin>>tm.s; } cout<<"nIs it A.M. or P.M. ??" <<"nEnter 1. A.M." <<"nEnter 2. P.M." <<"nnYour choice : "; cin>>tm.t; while(tm.t!=1&&tm.t!=2) { cout<<"Invalid time re-enter : "; cin>>tm.t; } if(tm.t==1) { strcpy(tm.tt,ta); // puts(tb); strcpy(tm.x,tb); } if(tm.t==2) { 41
  • 42. strcpy(tm.tt,tb); // puts(ta); strcpy(tm.x,ta); } tm.tt[4]='0'; tm.x[4]='0'; distm(); tmchg(); } void distm() { gotoxy(15,15); cprintf(" "); cout<<tm.h<<":" <<tm.m<<":" <<tm.s<<" " <<tm.tt; } void tmchg() { for(int a=tm.h;a<=12;a++) { 42
  • 43. for(int b=tm.m;b<60;b++) { for(int c=tm.s;c<=60;c++) { delay(1003); // gotoxy(15,15); distm(); tm.s++; if(kbhit()) { delay(500); gotoxy(7,25); cout<<"Time Stopped !!!!"; delay(1000); cout<<"Terminating......."; delay(2000); } if(tm.h==12&&tm.m==59&&tm.s==60) { tm.h=1; a=1; tm.m=0; b=0; 43
  • 44. tm.s=0; c=0; swap(tm.tt,tm.x); } } tm.m++; tm.s=00; } tm.h++; tm.m=00; } } void swap(char a[5], char b[5]) { char c[5]; strcpy(c,a); strcpy(a,b); strcpy(b,c); } 44
  • 45. 45
  • 46. 46
  • 47. 47
  • 48. 48