[BSI] Tugas Kuliah Pra UAS

Kali ini, saya akan mencoba mempublish tugas yang diberikan dosen pemograman c++ (SCR). Berikut Penampakannya….

Dan berikut ini scriptnya, selamat mencoba…
#include<conio.h>
#include<stdio.h>
#include<iostream.h>
char* ukurankebab(char koukur)
{
if(koukur==’P’)
{return”Personal”;}
else
if(koukur==’S’)
{return”Sedang”;}
else
{return”Besar”;}
}
main()
{
class
{
public:
char kokebab [2],*nakebab,koukur,*ukuran;
int harga;
}kebab;
char nama[20],lagi;
float jumbel,subtotal,potongan,tobay,ubay,ukem;
awal:
clrscr();
cout<<“******************************************”<<endl;
cout<<”            TOKO KEBAB RISKY”<<endl;
cout<<“******************************************”<<endl;
cout<<“Nama Pembeli    : “;gets(nama);
cout<<“Nama Kebab”<<endl;
cout<<“[KT] Kebab Turki”<<endl;
cout<<“[KM] Kebab Mesir”<<endl;
cout<<“[KI] Kebab India”<<endl<<endl;
cout<<“Kode Kebab      : “;cin>>kebab.kokebab;
cout<<“Ukuran [P|S|B]  : “;cin>>kebab.koukur;
cout<<“Jumlah Beli     : “;cin>>jumbel;
if(!strcmp(kebab.kokebab,”KT”)||!strcmp(kebab.kokebab,”kt”))
{
kebab.nakebab=”Kebab Turki”;
if(kebab.koukur==’P’)
{kebab.harga=30000;}
else
if(kebab.koukur==’S’)
{kebab.harga=50000;}
else
{kebab.harga=80000;}
}
else
if(!strcmp(kebab.kokebab,”KM”)||!strcmp(kebab.kokebab,”km”))
{
kebab.nakebab=”Kebab Mesir”;
if(kebab.koukur==’P’)
{kebab.harga=40000;}
else
if(kebab.koukur==’S’)
{kebab.harga=60000;}
else
{kebab.harga=90000;}
}
else
{
kebab.nakebab=”Kebab India”;
if(kebab.koukur==’P’)
{kebab.harga=50000;}
else
if(kebab.koukur==’S’)
{kebab.harga=70000;}
else
{kebab.harga=100000;}
}

subtotal=jumbel*kebab.harga;
if(jumbel>5)
{potongan=0.1*subtotal;}
else
{potongan=0.05*subtotal;}
tobay=subtotal-potongan;
clrscr();
cout<<“******************************************”<<endl;
cout<<”         DETAIL PEMBELIAN KEBAB”<<endl;
cout<<“******************************************”<<endl;
cout<<“Nama Pembeli       : “<<nama<<endl;
cout<<“Nama Kebab         : “<<kebab.nakebab<<endl;
cout<<“Ukuran Kebab       : “<<ukurankebab (kebab.koukur)<<endl;
cout<<“Harga              : Rp. “<<kebab.harga<<endl;
cout<<“Jumlah Beli        : “<<jumbel<<endl;
cout<<“******************************************”<<endl;
cout<<“Subtotal           : Rp. “<<subtotal<<endl;
cout<<“Potongan           : Rp. “<<potongan<<endl;
cout<<“Total Bayar        : Rp. “<<tobay<<endl;
cout<<“******************************************”<<endl;
cout<<“Uang Bayar         : Rp. “;cin>>ubay;
ukem=ubay-tobay;
cout<<“Uang Kembali       : Rp. “<<ukem<<endl;
cout<<“******************************************”<<endl;
cout<<“Input Data Lagi [Y/T]…? “;cin>>lagi;
if(lagi==’Y’||lagi==’y’)
{goto awal;}
getch();
}

7 Comments

  1. amie says:

    ini tugas yang buat anak 12.2B.01 bukan?

  2. admin says:

    @amie : saya kurang tahu kalau untuk kelas lain juga, saya di kelas 131d01

    1. amie says:

      tanya dong tau blognya dosen SCR ga? cz kelas w jga ada tugas tp w lupa catet blognya apa….

  3. admin says:

    @amie : itu sudah saya kasih link di atas, :D. Kalo gak nemu, ini web-nya, http://www.scraccess.co.cc

  4. teguh oki (oky tgh) says:

    keren ms stia blognya,, ajarin dong,, bkinnya,, oy kl punya email,, yahoo,, bisa g bkin blog mas?

    1. admin says:

      saya juga masih belajar kok, 🙂
      bisa aja, emailku juga yahoo…

Leave a Reply

Your email address will not be published. Required fields are marked *