1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
#include <stdio.h>
#define DIM 512
#define MAXCHAR 30
int main()
{
void op1();
int option;
printf(" *** Welcome to HK Grand SPACE Movie Ticketing Management System 2017 ***\n");
printf(" *** This system is developed by CCIT4020 Class No.CL-?? Group No.?? ***\n");
printf("\n--<Basic Functions>--\n");
printf("1. Add New Movie Ticketing Record(s) \n");
printf("2. Display ALL Movie Ticketing Records \n");
printf("3. Modify Movie Ticketing Record(s) \n");
printf("4. Search Movie Ticketing Record(s) \n");
printf("5. Delete Movie Ticketing Record(s) \n");
printf("What is your Option <1-5>?");
scanf("%d",&option);
switch (option)
{
case 1:
op1();
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
}
}
void op1()
{
FILE *myfile = NULL;
char bknum[DIM], customer[MAXCHAR], movie[MAXCHAR], date[DIM], time[DIM];
char guest[DIM], house[DIM], ticket[MAXCHAR], fee[DIM];
myfile = fopen("project.txt", "a+");
if (myfile == NULL)
{
printf("File open failed!! Exiting!!\n");
}
printf("Please enter Booking Number:\n");
fgets(bknum, DIM, stdin);
printf("Please enter Customer Name:\n");
fgets(customer, MAXCHAR, stdin);
printf("Please enter Movie Name:\n");
fgets(movie, MAXCHAR, stdin);
printf("Please enter the Movie Date:\n");
fgets(date, DIM, stdin);
printf("Please enter Movie Time\n");
fgets(time, DIM, stdin);
printf("Please enter Number of Guests:\n");
fgets(guest, DIM, stdin);
printf("Please enter House Number:\n");
fgets(house, DIM, stdin);
printf("Please enter Ticket Types:\n");
fgets(ticket, MAXCHAR, stdin);
printf("Please enter Total Fee:\n");
fgets(fee, DIM, stdin);
fprintf(myfile, "\n%s", bknum);
fprintf(myfile, "%s", customer);
fprintf(myfile, "%s", movie);
fprintf(myfile, "%s", date);
fprintf(myfile, "%s", time);
fprintf(myfile, "%s", guest);
fprintf(myfile, "%s", house);
fprintf(myfile, "%s", ticket);
fprintf(myfile, "%s", fee);
fclose (myfile);
}
|