hari ini masbro rezky akan memposting contoh program warteg pake menu yg saya compile melalui devC++...
#include<iostream>
using namespace std;
main()
{
char pilih,menu[15],bonus[20];
int clrscr();
cout<<"Warteg MASBRO"<<endl;
cout<<"==================="<<endl;
cout<<"Pilihan Menu :"<<endl;
cout<<"A. Jengkoletot"<<endl;
cout<<"B. Peterongan"<<endl;
cout<<"----------------------"<<endl;
cout<<"Pilih Menu Warteg [A/B]:
";cin>>pilih;
cout<<endl;
if (pilih=='A' || pilih=='a')
{
strcpy(menu,"Jengkoletot");
strcpy(bonus,"Teh Manis");
}
else if (pilih=='B' || pilih=='b')
{
strcpy(menu,"Peterongan");
strcpy(bonus,"Jus Melon");
}
else
{
strcpy(menu,"Tidak pilih menu");
strcpy(bonus,"Tidak dapat bonus");
}
cout<<"----------------------"<<endl;
cout<<"Anda memilih menu :
"<<menu<<endl;
cout<<"Anda mendapat bonus :
"<<bonus<<endl;
system("pause");
}
-SEMOGA BERMANFAAT (http://masbronotes.blogspot.com)
No comments:
Post a Comment