Jump to content

arief_92

Learning
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by arief_92

  1. Assalamualaikum.. dan selamat sejahtera.. Saya ada satu masalah..saya nak wat programming ttg Cinema Ticket Booking System.. Masalahnya saya xtau nak mempamerkan seat2 yang ade kat wayang tu.. Klu ade sape2 yang tahu.. Tolong ajarkan saya.. Ini sebahagian code yang baru dirangka: [CODE] #include <stdio.h> int booking(int a); int year(int ; int categories(int c); int movies(int d); int time(int e); int special(int f); void main() { printf("********GREETINGS ! WELCOME TO A'S CINEMA ! ********\n\a"); int book; printf(" Would you like to book by walk through or online booking ?\n\a"); printf(" 1 for walk through.\n 2 for online booking.\n\a"); scanf("%d", &book); { int booking(int a); if(book==1) { printf(" How old are you ?\n\a"); } else if(book==2) { printf(" How old are you ?\n\a"); } else printf("Not both ? Thanks. Please come again. \n\a"); } int age; scanf("%d", &age); int year(int ; if(age>=18) { printf(" Which category are you from ? \n\a"); printf(" 1 for student.\n 2 for children.\n 3 for adult.\n 4 for family. \n\a"); } else if(age<18) { printf(" Which category are you from ? \n\a"); printf(" 1 for student.\n 2 for children.\n 3 for adult.\n 4 for family. \n\a"); } int category; scanf("%d", &category); int categories(int c); if(category==1) { printf(" What is your IC and student ID number ? \n\a"); int IC[13]; int ID[11]; printf(" IC number : "); scanf("%s", &IC); printf(" Your IC number is : %s\n\a", IC); printf(" ID number : "); scanf("%s", &ID); printf(" Your ID number is : %s\n\a", ID); printf(" Your price discount is -RM 4 \n\n\a"); printf(" What movie do you like to watch ? \n\a"); printf(" 1 for 'Fast Five'.\n 2 for 'Ombak Rindu'.\n 3 for 'Cars 2'.\n 4 for 'Adnan Sempit 2'.\n\a"); } else if(category==2) { printf(" Your price discount is -RM 3 \n\n\a"); printf(" What movie do you like to watch ? \n\a"); printf(" 1 for 'Fast Five'.\n 2 for 'Ombak Rindu'.\n 3 for 'Cars 2'.\n 4 for 'Adnan Sempit 2'.\n\a"); } else if(category==3) { printf(" Your price discount is -RM 2 \n\n\a"); printf(" What movie do you like to watch ? \n\a"); printf(" 1 for 'Fast Five'.\n 2 for 'Ombak Rindu'.\n 3 for 'Cars 2'.\n 4 for 'Adnan Sempit 2'.\n\a"); } else if(category==4) { printf(" Your price discount is -RM 1 per person \n\n\a"); printf(" What movie do you like to watch ? \n\a"); printf(" 1 for 'Fast Five'.\n 2 for 'Ombak Rindu'.\n 3 for 'Cars 2'.\n 4 for 'Adnan Sempit 2'.\n\a"); } int movie; scanf("%d", &movie); int movies(int d); if(movie==1) { printf(" At what time ? \n\a"); printf(" 1 for morning at 10.00am.\n 2 for afternoon at 12.20pm.\n 3 for night at 10.00pm.\n\a"); } else if(movie==2) { printf(" At what time ? \n\a"); printf(" 1 for morning at 10.00am.\n 2 for afternoon at 12.20pm.\n 3 for night at 10.00pm.\n\a"); } else if(movie==3) { printf(" At what time ? \n\a"); printf(" 1 for morning at 10.00am.\n 2 for afternoon at 12.20pm.\n 3 for night at 10.00pm.\n\a"); } else if(movie==4) { printf(" At what time ? \n\a"); printf(" 1 for morning at 10.00am.\n 2 for afternoon at 12.20pm.\n 3 for night at 10.00pm.\n\a"); } int hour; scanf("%d", &hour); int time(int e); if(hour==1) { printf(" What special movie category would you like ? \n\a"); printf(" 1 for 'Blockbuster'.\n 2 for 'Super Wednesday'.\n 3 for 'Saturday Sunday'.\n 4 for 'Midnight'.\n\a"); } else if(hour==2) { printf(" What special movie category would you like ? \n\a"); printf(" 1 for 'Blockbuster'.\n 2 for 'Super Wednesday'.\n 3 for 'Saturday Sunday'.\n 4 for 'Midnight'.\n\a"); } else if(hour==3) { printf(" What special movie category would you like ? \n\a"); printf(" 1 for 'Blockbuster'.\n 2 for 'Super Wednesday'.\n 3 for 'Saturday Sunday'.\n 4 for 'Midnight'.\n\a"); } int scategory; scanf("%d", &scategory); int special(int f); if(scategory==1) { printf(" The price for this ticket is RM 13 per person.\n\n\a"); printf(" What class would you like ?\n\a"); printf(" 1 for 'Gold Class'.\n 2 for 'Couple seat'.\n 3 for 'Standard'.\n\a"); } if(scategory==2) { printf(" The price for this ticket is RM 19 per person.\n\n\a"); printf(" What class would you like ?\n\a"); printf(" 1 for 'Gold Class'.\n 2 for 'Couple seat'.\n 3 for 'Standard'.\n\a"); } if(scategory==3) { printf(" The price for this ticket is RM 12 per person.\n\n\a"); printf(" What class would you like ?\n\a"); printf(" 1 for 'Gold Class'.\n 2 for 'Couple seat'.\n 3 for 'Standard'.\n\a"); } if(scategory==4) { printf(" The price for this ticket is RM 11 per person.\n\n\a"); printf(" What class would you like ?\n\a"); printf(" 1 for 'Gold Class'.\n 2 for 'Couple seat'.\n 3 for 'Standard'.\n\a"); } } [/CODE]
×
×
  • Create New...