#include<iostream>
#include<string>
#include<conio.h>
using namespace std;
int main(){
string id,pass,pesanan;
int umur,pilih,harga,diskon,bayar,uang,jumlah;
cout<<"\tNama Lengkap : Yoga Firza Sabbihisma\n";
cout<<"\tNIM : 1700018253\n";
cout<<"\ttKelas : Teknik Informatika\n";
cout<<"==================================================================================================================\n\n";
cout<<"\tMasukkan Username : "; cin>>id;
cout<<"\tMasukkan Password : "; cin>>pass;
cout<<"\t---------------------------------------\n\n";
if(id=="YogaFirza" && pass=="1700018253"){
cout<<"\tBerapa Umur Anda ? "; cin>>umur;
if(umur>12){
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng Pedas = 12.000\n";
cout<<"2.Nasi Remes = 9.000\n";
cout<<"3.Pecel Lele = 13.000\n";
cout<<"4.Ayam Balado = 15.000\n";
cout<<"----------------------------------\n";
ulangi:
cout<<"Masukkan Pilihan Anda(1-4) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng Pedas";
harga = 12000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Remes";
harga = 9000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Pecel Lele";
harga = 13000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 4:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Balado";
harga = 15000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
default : goto ulangi;
}
cout<<"\n'ANDA DAPAT DISKON 10 %' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Harga = "<<"Rp."<<harga<<endl;
cout<<"Diskon Sebesar = "<<"Rp."<<diskon<<endl;
cout<<"\nTotal Bayar Anda = "<<"Rp."<<bayar<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>bayar){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-bayar;
}
else if(uang<bayar){
cout<<"\nUang Anda Kurang = "<<"Rp."<<bayar-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}else{
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng = 11.000\n";
cout<<"2.Ayam Goreng = 9.000\n";
cout<<"3.Ikan Kukus = 8.000\n";
cout<<"----------------------------------\n";
ulangi2:
cout<<"Masukkan Pilihan Anda(1-3) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng";
harga = 11000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Goreng";
harga = 9000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ikan Kukus";
harga = 8000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
default : goto ulangi2;
}
cout<<"\n'ANDA DAPAT DISKON 10 %' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Harga = "<<"Rp."<<harga<<endl;
cout<<"Diskon Sebesar = "<<"Rp."<<diskon<<endl;
cout<<"\nTotal Bayar Anda = "<<"Rp."<<bayar<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>bayar){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-bayar;
}
else if(uang<bayar){
cout<<"\nUang Anda Kurang = "<<"Rp."<<bayar-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}
}
else{
cout<<"\tBerapa Umur Anda ? "; cin>>umur;
if(umur>12){
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng Pedas = 12.000\n";
cout<<"2.Nasi Remes = 9.000\n";
cout<<"3.Pecel Lele = 13.000\n";
cout<<"4.Ayam Balado = 15.000\n";
cout<<"----------------------------------\n";
ulangi3:
cout<<"Masukkan Pilihan Anda(1-4) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng Pedas";
harga = 12000*jumlah;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Remes";
harga = 9000*jumlah;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Pecel Lele";
harga = 13000*jumlah;
break;
case 4:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Balado";
harga = 15000*jumlah;
break;
default : goto ulangi3;
}
cout<<"\n'ANDA TIDAK DAPAT DISKON' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Bayar Anda = "<<"Rp."<<harga<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>harga){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-harga;
}
else if(uang<harga){
cout<<"\nUang Anda Kurang = "<<"Rp."<<harga-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}else{
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng = 11.000\n";
cout<<"2.Ayam Goreng = 9.000\n";
cout<<"3.Ikan Kukus = 8.000\n";
cout<<"----------------------------------\n";
ulangi4:
cout<<"Masukkan Pilihan Anda(1-3) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng";
harga = 11000*jumlah;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Goreng";
harga = 9000*jumlah;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ikan Kukus";
harga = 8000*jumlah;
break;
default : goto ulangi4;
}
cout<<"\n'ANDA TIDAK DAPAT DISKON' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Bayar Anda = "<<"Rp."<<harga<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>harga){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-harga;
}
else if(uang<harga){
cout<<"\nUang Anda Kurang = "<<"Rp."<<harga-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}
}
getch();
return 0;
}
#include<string>
#include<conio.h>
using namespace std;
int main(){
string id,pass,pesanan;
int umur,pilih,harga,diskon,bayar,uang,jumlah;
cout<<"\tNama Lengkap : Yoga Firza Sabbihisma\n";
cout<<"\tNIM : 1700018253\n";
cout<<"\ttKelas : Teknik Informatika\n";
cout<<"==================================================================================================================\n\n";
cout<<"\tMasukkan Username : "; cin>>id;
cout<<"\tMasukkan Password : "; cin>>pass;
cout<<"\t---------------------------------------\n\n";
if(id=="YogaFirza" && pass=="1700018253"){
cout<<"\tBerapa Umur Anda ? "; cin>>umur;
if(umur>12){
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng Pedas = 12.000\n";
cout<<"2.Nasi Remes = 9.000\n";
cout<<"3.Pecel Lele = 13.000\n";
cout<<"4.Ayam Balado = 15.000\n";
cout<<"----------------------------------\n";
ulangi:
cout<<"Masukkan Pilihan Anda(1-4) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng Pedas";
harga = 12000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Remes";
harga = 9000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Pecel Lele";
harga = 13000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 4:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Balado";
harga = 15000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
default : goto ulangi;
}
cout<<"\n'ANDA DAPAT DISKON 10 %' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Harga = "<<"Rp."<<harga<<endl;
cout<<"Diskon Sebesar = "<<"Rp."<<diskon<<endl;
cout<<"\nTotal Bayar Anda = "<<"Rp."<<bayar<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>bayar){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-bayar;
}
else if(uang<bayar){
cout<<"\nUang Anda Kurang = "<<"Rp."<<bayar-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}else{
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng = 11.000\n";
cout<<"2.Ayam Goreng = 9.000\n";
cout<<"3.Ikan Kukus = 8.000\n";
cout<<"----------------------------------\n";
ulangi2:
cout<<"Masukkan Pilihan Anda(1-3) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng";
harga = 11000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Goreng";
harga = 9000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ikan Kukus";
harga = 8000*jumlah;
diskon = harga*0.1;
bayar = harga-diskon;
break;
default : goto ulangi2;
}
cout<<"\n'ANDA DAPAT DISKON 10 %' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Harga = "<<"Rp."<<harga<<endl;
cout<<"Diskon Sebesar = "<<"Rp."<<diskon<<endl;
cout<<"\nTotal Bayar Anda = "<<"Rp."<<bayar<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>bayar){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-bayar;
}
else if(uang<bayar){
cout<<"\nUang Anda Kurang = "<<"Rp."<<bayar-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}
}
else{
cout<<"\tBerapa Umur Anda ? "; cin>>umur;
if(umur>12){
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng Pedas = 12.000\n";
cout<<"2.Nasi Remes = 9.000\n";
cout<<"3.Pecel Lele = 13.000\n";
cout<<"4.Ayam Balado = 15.000\n";
cout<<"----------------------------------\n";
ulangi3:
cout<<"Masukkan Pilihan Anda(1-4) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng Pedas";
harga = 12000*jumlah;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Remes";
harga = 9000*jumlah;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Pecel Lele";
harga = 13000*jumlah;
break;
case 4:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Balado";
harga = 15000*jumlah;
break;
default : goto ulangi3;
}
cout<<"\n'ANDA TIDAK DAPAT DISKON' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Bayar Anda = "<<"Rp."<<harga<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>harga){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-harga;
}
else if(uang<harga){
cout<<"\nUang Anda Kurang = "<<"Rp."<<harga-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}else{
cout<<"\nMenu Makan : \n";
cout<<"1.Nasi Goreng = 11.000\n";
cout<<"2.Ayam Goreng = 9.000\n";
cout<<"3.Ikan Kukus = 8.000\n";
cout<<"----------------------------------\n";
ulangi4:
cout<<"Masukkan Pilihan Anda(1-3) : "; cin>>pilih;
switch(pilih){
case 1:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Nasi Goreng";
harga = 11000*jumlah;
break;
case 2:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ayam Goreng";
harga = 9000*jumlah;
break;
case 3:
cout<<"Jumlah Pemesanan : "; cin>>jumlah;
pesanan = "Ikan Kukus";
harga = 8000*jumlah;
break;
default : goto ulangi4;
}
cout<<"\n'ANDA TIDAK DAPAT DISKON' \n";
cout<<"--------------------------------------\n";
cout<<"Nama Pesanan = "<<pesanan<<endl;
cout<<"Total Bayar Anda = "<<"Rp."<<harga<<endl;
cout<<"Masukkan Jumlah Uang Anda = Rp."; cin>>uang;
if(uang>harga){
cout<<"\nKembalian Anda = "<<"Rp."<<uang-harga;
}
else if(uang<harga){
cout<<"\nUang Anda Kurang = "<<"Rp."<<harga-uang;
}
else{
cout<<"\nUang Anda Pas";
}
}
}
getch();
return 0;
}