Minggu, 09 November 2014

Soal quis C++ bsi semester 1 tahun 2014 type A

Tampilan Input :

Tampilan Output :


Listing code :
//Nama :
//Nim :


#include <stdio.h>
#include <conio.h>
#include <iostream.h>

main()
{

char notrans[10],nama[20],kodbunga,kodpaket,paket[10],nabung[10],lagi;
long jumbel,harga,totbay,ubay,ukem;
awal:
clrscr();

cout<<"\t\t\t TOKO BUNGA"<<endl;
cout<<"\t\t\t DAISY FLOWERS"<<endl;
puts("\t\t ****************************");
cout<<"Input No Transaksi  :";cin>>notrans;
cout<<"Input Nama Pembeli  :";cin>>nama;
puts("==============================================");

cout<<"Input Kode Bunga[M/L/T]       :";cin>>kodbunga;
cout<<"Input Kode Paket Bunga [S/B]  :";cin>>kodpaket;
cout<<"Input Jumlah Beli             :";cin>>jumbel;

if(kodbunga=='M'||kodbunga=='m')
{
    strcpy(nabung,"Mawar");
    if(kodpaket=='S'||kodpaket=='s')
    {harga=20000;
   strcpy(paket,"Single"); }
      else if(kodpaket=='B'||kodpaket=='b')
   {harga=55000;
   strcpy(paket,"Bucket");}
   else
    {harga=0;}
}

else if(kodbunga=='L'||kodbunga=='l')
{
    strcpy(nabung,"Lily");                                  
    if(kodpaket=='S'||kodpaket=='s')
    {harga=25000;
   strcpy(paket,"Single");}
    else if(kodpaket=='B'||kodpaket=='b')
    {harga=75000;
   strcpy(paket,"Bucket");}
    else
    {harga=0;}
}

else if(kodbunga=='T'||kodbunga=='t')
{
    strcpy(nabung,"Tulip");
    if(kodpaket=='S'||kodpaket=='s')
    {harga=15000;
   strcpy(paket,"Single");}
   else if(kodpaket=='B'||kodpaket=='b')
    {harga=80000;
   strcpy(paket,"Bucket");}
    else
    {harga=0;}
}
clrscr();

cout<<"\t\t\t STRUK PEMBELIAN BUNGA"<<endl;
cout<<"\t\t\t TOKO BUNGA"<<endl;
cout<<"\t\t\t DAISY FLOWERS"<<endl;
puts("\t\t\t ***********************");
cout<<"No Transaksi  :"<<notrans<<endl;
cout<<"Nama Pembeli  :"<<nama<<endl;
puts("============================================");
cout<<"Nama Bunga  :"<<nabung<<endl;
cout<<"Paket Bunga :"<<paket<<endl;
cout<<"Harga       :"<<harga<<endl;
cout<<"Jumlah Beli :"<<jumbel<<endl;
puts("============================================");
totbay=harga*jumbel;
cout<<"\t\t\t Total Bayar  :"<<totbay<<endl;
cout<<"\t\t\t Uang Bayar   :";cin>>ubay;
ukem=ubay-totbay;
cout<<"\t\t\t Uang Kembali :"<<ukem<<endl;
cout<<endl<<endl;

cout<<"\n Ingin Input Lagi[Y/T]  :";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto awal;

getch();
}

Sekian Terima Kasih.......
Jangan Lupa Komentarnya 

Tidak ada komentar:

Posting Komentar