Daftpunk 1 Report post Posted October 7, 2010 assalamualaikum guys. saya ada satu perkara nk mintak tlg. saya tak tahu coding bagi soalan ni yg terdapat dlm assignment saya : Q3 Write an interactive, menu-driven C program of fitness center information and reservation system apakah coding untuk login program itu? Quote Share this post Link to post Share on other sites
hotfloppy 19 Report post Posted October 17, 2010 biasanya coding dia start gini: [code]#include <stdio.h>[/code] Quote Share this post Link to post Share on other sites
ram2i 0 Report post Posted January 26, 2011 Just to share: Menu driven maksudnye boleh pilih task berdasarkan list menu yg kita buat. [code] Please select your menu (Enter 1-3 only): 1. Add user 2. Find user 3. Delete user User select > _ [/code] Sample coding (Borland Turbo C++ compiler - oldskool tapi very2 good). [img]https://sites.google.com/site/myccodesnippet/_/rsrc/1296033684639/home/sample_menu_driven.PNG[/img] [code] // compiler: Turbo C++ v3.1 for Windows // level: beginner #include <stdio.h> #include <conio.h> // definition - untuk senangkan kejer #define p printf #define ESC 0x1B // function prototypes void Show_Menu(void); void Process_Input (int selection); // boleh call byk kali, so letak kat function void Show_Menu(void) { p("\nMENU:\n"); p("1. Add user\n"); p("2. Find user\n"); p("3. Remove user\n"); p("Enter selection (ESC to quit) > "); } // proses input yang user tekan - kat sini macam2 lagi boleh buat... void Process_Input (int selection) { p("\n"); switch (selection) { case '1': p("...Task 1: Add user. There is lots more to do here..open file...get user name, info, etc..save file..close it.\n"); break; case '2': p("...Task 2: Find user. Open file...find user...print info..close file.\n"); break; case '3': p("...Task 3: Remove user. Open file...find user...remove info..close file.\n"); break; default: p("Unknown -> %02X!\n", selection); break; } } // main loop - guna void, xyah return integer i.e return 0 void main() { int user_press; p("\n=== Menu driven sample program by Ramzi ===\n"); // infinite loop while (1) { // tiap kali loop - tunjuk menu Show_Menu(); // dapatkan menu selection dari user - tekan keyboard, hanya 1-3 sahaja, boleh tambah sukati... user_press = getch(); // untuk valid nombor shj yg perlu print, kalau nk print sumer, comment if statement if (user_press > '0' && user_press < '4') { p("%c", user_press); } // kalau user tekan ESCAPE, exit while loop if (user_press == ESC) break; // user tak tekan ESCAPE, jadi proses input else Process_Input(user_press); } p("\nUser terminate application!\n"); } [/code] Byk lagi yg boleh di olah & ditambah...atas kreativiti masing2... Quote Share this post Link to post Share on other sites
elsewhere 2 Report post Posted January 26, 2011 naseb bek suruh buat menu jek x suruh wat database dia skali Quote Share this post Link to post Share on other sites
msr_2.0 0 Report post Posted January 30, 2011 [quote name='AmD SeMpoT (SeMpRoN)' timestamp='1286455555' post='1049648'] assalamualaikum guys. saya ada satu perkara nk mintak tlg. saya tak tahu coding bagi soalan ni yg terdapat dlm assignment saya : Q3 Write an interactive, menu-driven C program of fitness center information and reservation system apakah coding untuk login program itu? [/quote] ni nak 'pencerahan' atau nak mintak orang tolong buatkan kerjarumah? Quote Share this post Link to post Share on other sites
otai_g 3 Report post Posted May 9, 2012 da siap da pun. tgk la cth yg ram2i tu poskan.. Quote Share this post Link to post Share on other sites