Penggunaan Menu Dalam C++

Posted: April 18, 2010 in Daspro
Tags:

#include<iostream.h>

#include<conio.h>

void main()

{

int no_menu;

clrscr();

cout<<“|==================================|”<<endl;

cout<<“|               Menu               |”<<endl;

cout<<“|==================================|”<<endl;

cout<<“|1 = Baca Data                     |”<<endl;

cout<<“|    2 = Cetak Data                |”<<endl;

cout<<“|        3 = Ubah Data             |”<<endl;

cout<<“|            4 = Hapus Data        |”<<endl;

cout<<“|                5 = Keluar Program|”<<endl;

cout<<“|==================================|”<<endl;

cout<<“Masukan Pilihan Anda : “;cin>>no_menu;

switch(no_menu)

{

case 1 :

cout<<“Anda Telah Memilih Menu No. 1″<<endl;

cout<<“Selamat Membaca”<<endl;

cout<<“Yes / No”<<endl;

break;

case 2 :

cout<<“Anda Telah Memilih Menu No. 2″<<endl;

cout<<“Anda Yakin Untuk mencetaknya?”<<endl;

cout<<“Yes / No”<<endl;

break;

case 3 :

cout<<“Anda Telah Memilih Menu No. 3″<<endl;

cout<<“Anda Yakin Untuk Merubahnya?”<<endl;

cout<<“Yes / No”<<endl;

break;

case 4 :

cout<<“Anda Telah Memilih Menu No. 4″<<endl;

cout<<“Apakah Anda Yakin Mengapus Data Ini??”<<endl;

cout<<“Yes / No”<<endl;

break;

case 5 :

cout<<“Anda Telah Memilih Menu No. 5″<<endl;

cout<<“Terima Kasih Banyak See U Again”<<endl;

break;

}

getch();

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s