Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

What are the primary functions of a pouring operation?

Answered: 1 week ago