Question: Q.28 code #include #include #include #include #include struct { char name[55]; char language[8]; char type[3]; char time[6]; int price; int ticket_booked; }mov; struct Node {

Q.28 code

#include #include #include #include #include

struct { char name[55]; char language[8]; char type[3]; char time[6]; int price; int ticket_booked; }mov;

struct Node { int data; struct Node *next; };

int main(void); void password(); void admin(); void add_movie(); void show_movie(); void delete_movie(); void audi(); void edit_movie(); void show_movie_user(); void book_ticket(); //void bubbleSort(struct Node *); void show_seats(struct Node*, int ); void cancel_ticket();

///////////////////////////////////////////////////ADMIN FUNCTIONS///////////////////////////////////////////////////

void admin() { int op; system("cls"); printf(" \t\t\tMOVIE TICKET BOOKING"); printf(" \tpress 1 to add movie \tpress 2 to show movie list \tpress 3 to Delete movie \tpress 4 for Audi Details \tPress 5 to Edit Movie Details \tpress 0 to exit \tEnter your choise - "); scanf("%d",&op); switch(op) { case 1: add_movie(); break; case 2: show_movie(); break; case 3: delete_movie(); break; case 4: audi(); break; case 5: edit_movie(); break; case 0: main(); break; }

void password() { system("cls"); printf(" \t\t\tMOVIE TICKET BOOKING"); char p[9],temp[9]; int i,flag = 1; FILE *fptr; fptr = fopen("pass.txt","r"); fgets(temp,9,fptr); while(flag) { printf(" \tEnter Password - "); for(i =0;i<8;i++) { p[i] = getch(); printf("*"); }

if(!strcmp(p,temp)) { admin();

} else { system("cls"); printf(" \t\t\tMOVIE TICKET BOOKING"); flag++; printf(" \tWRONG PASSWORD!!!"); if(flag == 4) main(); } fclose(fptr); } }

//////////////////////////////////////////////////////////MAIN FUNCTION/////////////////////////////////////////////////////

int main(void) { system("cls"); int option1; printf(" \t\t\tMOVIE TICKET BOOKING"); printf(" \tPress 1 for Admin \tPress 2 to see movies \tPress 3 to Book Ticket \tPress 4 to Cancel Ticket \tPress 5 to Exit \tEnter your choice - "); fflush(stdin); scanf("%d",&option1); switch (option1) { case 1: password(); break;

case 2: show_movie_user(); break;

case 3: book_ticket(); break;

case 4: cancel_ticket(); break;

case 5: exit(0); default : printf(" \t\t WRONG INPUT"); getch(); main();

} }

Answer Correctly!!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!