ane sedikit share yang suka Mata Kuliah Algoritma
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
char kode, *nabar, lagi;
int uk, jumbel;
double harga, total, ubay, ukem;
atas:
clrscr();
cout<<"Toko KELONTONG KERONCONGAN"<<endl;
cout<<"-----------------------------"<<endl;
cout<<"A. Susu Dancow"<<endl;
cout<<" 1. Kecil"<<endl;
cout<<" 2. Sedang"<<endl;
cout<<" 3. Besar"<<endl<<endl;
cout<<"B. Susu Bendera"<<endl;
cout<<" 1. Kecil"<<endl;
cout<<" 2. Sedang"<<endl;
cout<<" 3. Besar"<<endl<<endl;
cout<<"C. Susu Dancow"<<endl;
cout<<" 1. Kecil"<<endl;
cout<<" 2. Sedang"<<endl;
cout<<" 3. Besar"<<endl<<endl;
cout<<"Masukan Kode Susu:";cin>>kode;
switch(kode)
case'A':
case'a':
cout<<"Masukan Ukuran Susu:";cin>>uk;
nabar="Dancow";
if(uk==1)
{harga=15000;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp."<<harga<<endl;
}
else if(uk==2)
{harga=20000;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else if(uk==3)
{harga=25000;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else
{
clrscr();
cout<<"Maaf....!!!\n";
cout<<"Anda Salah memasukan kode ukuran susu, pilih1/2/3/4?"<<endl;
cout<<"press enter";
getche();
goto atas;
}
cout<<"Masukan Kode Susu:";cin>>kode;
switch(kode)
case'B':
case'b':
cout<<"Masukan Ukuran Susu:";cin>>uk;
nabar="Bendera";
if(uk==1)
{
harga=13500;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else if(uk==2)
{harga=17500;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else if(uk==3)
{harga=20000;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else
{
clrscr();
cout<<"Maaf....!!!\n";
cout<<"Anda Salah memasukan kode ukuran susu, pilih1/2/3/4?"<<endl;
cout<<"press enter";
getche();
goto atas;
}
cout<<"Masukan Kode Susu:";cin>>kode;
switch(kode)
case'C':
case'c':
cout<<"Masukan Ukuran Susu:";cin>>uk;
nabar="SGM";
if(uk==1)
{
harga=15000;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else if(uk==2)
{
harga=18500;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else if(uk==3)
{harga=22000;
clrscr();
cout<<endl;
cout<<"Jenis Susu ="<<nabar<<endl;
cout<<"Ukuran Kaleng ="<<uk<<endl;
cout<<"Harga Susu =Rp"<<harga<<endl;
}
else
{
clrscr();
cout<<"Maaf....!!!\n";
cout<<"Anda Salah memasukan kode ukuran susu, pilih1/2/3/4?"<<endl;
cout<<"press enter";
getche();
goto atas;
}
cout<<"Masukan Jenis Susu :"<<nabar<<endl;
cout<<"Masukan Ukuran Kaleng :"<<uk<<endl;
cout<<"Harga Satuan Barang :"<<harga<<endl;
ubay=(uk*harga);
cout<<"Jumlah Yang Dibeli :"<<jumbel<<endl;
jumbel=(ubay*jumbel);
cout<<"Harga Yang Harus Dibayar Sebesar Rp."<<total<<endl;
total=(jumbel*harga);
getche();
}
0 comments:
Post a Comment