jangan lupa ganti namanya kalo Copas cuy!
#include <iostream>
using namespace std;
int main()
{
int biaya, hari, anggora, persia, maine;
char P;
char A;
char M;
char kucing,b,n;
input :
cout<<"========================================"<<endl;
cout<<" PROGRAM BIAYA PENITIPAN KUCING "<<endl;
cout<<" PROGRAMED BY ANGGRI LUKMAN "<<endl;
cout<<"========================================"<<endl;
cout<<"pilih jenis kucing :"<<endl;
cout<<"tekan A untuk Anggora"<<endl;
cout<<"tekan P untuk Persia"<<endl;
cout<<"tekan M untuk Maine coon"<<endl;
cout<<"========================="<<endl;
cin>>kucing;
if(kucing == 'A' || kucing == 'a' )
{
anggora=100000;
cout<<"lama penitipan kucing anggora : ";cin>>hari;
biaya=anggora*hari;cout<<endl;
cout <<"biaya penitipan : "<<biaya;goto lanjut;
}
else if (kucing == 'P' ||kucing == 'p')
{
persia=150000;
cout<<"Lama penitipan kucing persia: ";cin>>hari;
biaya= persia*hari;cout<<endl;
cout <<"biaya penitipan : "<<biaya;goto lanjut;
}
else if (kucing == 'M' || kucing == 'm')
{
maine=175000;
cout<<"Lama penitipan kucing Maine coon : ";cin>>hari;
biaya=maine*hari;cout<<endl;
cout <<"biaya penitipan : "<<biaya;goto lanjut;
}
else
{
cout <<"-------------------------------------------------------------"<<endl;
cout <<"data yang anda masukan salah, mohon masukan data dengan benar"<<endl;
cout <<"-------------------------------------------------------------"<<endl;
goto input;
}
lanjut :
{
cout<<"\n\n*>ingin menghitung lagi? (Y/N)) ";cin>>b;
if (b == 'Y' || b== 'y')
{
goto input;
}
else if (b == 'N' || b== 'n')
{
cout<<"\n TERIMA KASIH";
cout<<"\n TELAH MENGGUNAKAN PROGRAM INI";
cout<<"\n|=====================================================|";
}
else
{
cout<<"\n INPUT SALAH";
}
}
}
Tidak ada komentar:
Posting Komentar