Dengan C++
#include <iostream>
#include <windows.h> //untuk mendeklarasikan CLS
using namespace std;
int main (int argc, char** argv){
int pil, nastel, nasyam, nassar, nasgor, nasor;
char back;
nastel=6000;
nasyam=8000;
nassar=7000;
nasgor=8500;
nasor=7500;
cout<<"1. nasi telor\n";
cout<<"2. nasi ayam\n";
cout<<"3. nasi sarden\n";
cout<<"4. nasi goreng\n";
cout<<"5. nasi orak arik\n";
menu:
cout<<"silahkan pilih menu : ";
cin>>pil;
switch(pil){
case 1:
cout<<"nasi telor\n";
cout<<"harga = "<<nastel;
cout<<"kembali";
break;
case 2:
cout<<"harga = "<<nasyam;
break;
case 3:
cout<<"harga = "<<nassar;
break;
case 4:
cout<<"harga = "<<nasgor;
break;
case 5:
cout<<"harga = "<<nasor;
break;
default:
cout<<"menu yang dimasukan tidak tersedia -_-";
}
cout<<endl<<endl;
goto menu;
return 0;
}
Tampilan