• Announcements

    • Peraturan Umum, Sila baca !

      1) Perbincangan illegal , seperti download , provide link muat turun, lanun sebagainya ditegah dan akan dipadam tanpa notis. Sila ambil perhatian , sebarang perbincangan mengenai download men-download, sharing link yang berkait kepada illegal material: - akan dipadam serta merta - tiada kompromi, user akan diberi warn jika melakukan kesalahan sama Contoh related : - " aku tengah sedut ni.. sejam lagi siap.. " - " kat mana ko dload laju gile.. aku lagi 14 hari nk siap" 2) Spamming, double pos, smiley semata-mata adalah satu kesalahan besar, elakkan membuat susulan pos dibawah susulan sendiri. Warning tanpa notis akan diberikan. 3) Elakkan drama fanboyism , samada berkait dengan konsol, permainan pc dan sebagainya 4) Perbincangan private server tidak dibenarkan, namun multiplayer via hamachi group dibenarkan. 5) Cheat codes dibenarkan, tetapi tidak kepada [email protected] 6) Screenshot seeloknya bersaiz 640 x 480 ke bawah, sila gunakan code spoiler sekiranya tidak resize pic anda. 7) One line posting (susulan satu baris) tanpa menjawab persoalan dan tidak memberi apa-apa manfaat dikira sebagai SPAM. SILA GUNAKAN FUNGSI REPORT JIKA TERDAPAT USER/TOPIK YANG MELANGGAR PERATURAN DI ATAS. ____________________________________________________________ _______________________________ .::. Kegagalan mematuhi terma dan syarat boleh mengakibatkan posting anda di padam dan anda mendapat warn level secara percuma .::. ____________________________________________________________ _______________________________
Sign in to follow this  
Followers 0

Nk Tanya Coding

6 posts in this topic

Posted · Report post

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?

Share this post


Link to post
Share on other sites

Posted · Report post

biasanya coding dia start gini:

[code]#include <stdio.h>[/code]


  :blush:

Share this post


Link to post
Share on other sites

Posted · Report post

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...

Share this post


Link to post
Share on other sites

Posted · Report post

naseb bek suruh buat menu jek x suruh wat database dia skali

Share this post


Link to post
Share on other sites

Posted · Report post

[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?

Share this post


Link to post
Share on other sites

Posted · Report post

da siap da pun. tgk la cth yg ram2i tu poskan..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0