Labels

Kamis, 06 September 2012

program kasir


#include <stdioh>
#include <iostreamh>
#include <conioh>
main()
{
int  total, b1, b2, b3, j1, j2, j3, tunai;
float h1,h2,h3,diskon,jml_pem,kemb1,kemb2;
printf("             Tugas Kasir SUHARTINI              \n");
printf("                NIM   : 421 11 016               \n");
printf("          Kelas : 1A d4 Teknik Listrik           \n");
printf("=================================================\n");
printf("\t Selamat Datang di ElektroMart \n");
printf("\t          Makassar           \n");
printf("=======================================\n");
printf("Masukkan Harga barang 1 = Rp ");scanf("%d",&b1);
printf("Masukkan Jumlah beli = ");scanf("%d",&j1);
h1=b1*j1;
printf("Harga = Rp %.f\n",h1);

printf("Masukkan harga barang 2 = Rp ");scanf("%d",&b2);
printf("Masukkan Jumlah beli = ");scanf("%d",&j2);
h2=b2*j2;
printf("Harga = Rp %.f\n",h2);
     printf("Masukkan harga barang 3 = Rp ");scanf("%d",&b3);
printf("Masukkan Jumlah beli = ");scanf("%d",&j3);
h3=b3*j3;
printf("Harga = Rp %.f\n",h3);
printf("=======================================\n");

jml_pem=(h1+h2+h3);
printf("Total belanja anda = Rp %.f\n",jml_pem);
if (jml_pem>=50000)
{
  cout<<"      Selamat Anda Mendapatkan Potongan 20% "<<endl;
  diskon=(jml_pem*20/100);
  total=(jml_pem-diskon);
  printf("                                                ");
  cout<<"\nTotal yang harus dibayar : Rp "<<total<<endl;
  printf("================================================");
  }
  if (jml_pem<50000) {
  printf("                                                ");
  cout<<"\nTotal yang harus dibayar : Rp "<<jml_pem<<endl;
  printf("================================================\n");
  }
  printf("\nCash = Rp "); scanf("%d",&tunai);
   if (jml_pem>=50000)
   {
   kemb1=(tunai-total);
   cout<<"\nKembalian anda : Rp "<<kemb1<<endl;
 }
if (jml_pem<50000)
{
kemb2=(tunai-jml_pem);
   cout<<"\nKembalian anda : Rp "<<kemb2<<endl;
printf("================================================\n");
}
 printf("\n      Terima kasih telah berbelanja disini       ");
 printf("\nBarang yang sudah dibeli tidak dapat dikembalikan");
 getch();
}

Tidak ada komentar:

Posting Komentar