Blogger templates

Pages

Senin, 28 Oktober 2013

"@" Pembelian Jaket C++.

Program C++ "Pembelian Jaket"

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

void main()
{
char notel[12],kojak,napem[30],koduk,urjak[5],merjak[15],lagi;
int jumbel,kembal,harga,bayar2,total;
awal:
cout<<"\t\t\t============================================"<<endl;
cout<<"\t\t\t\t  JAKET SERBA NYAMAN\n";
cout<<"\t\t\t============================================"<<endl;
cout<<"Nama Pembeli   :";cin>>napem;
cout<<"Nomor Tlp      :";cin>>notel;
cout<<"=================================================="<<endl;
cout<<"Pilihan Kode Jaket :\n";
cout<<"\t\t1. Eiger\n";
cout<<"\t\t2. Polo\n";
cout<<"=================================================="<<endl;
cout<<"Pilih Kode Jaket [1/2]        :";cin>>kojak;
cout<<"Ukuran Jaket [S/M/L}          :";cin>>urjak;
cout<<"Jumlah Beli                   :";cin>>jumbel;

if(kojak=='1')
{
   strcpy(merjak,"Eiger");
if(koduk=='s'||koduk=='S')
  strcpy(urjak,"S");
   harga=150000;
if(koduk=='m'||koduk=='M')
  strcpy(urjak,"M");
  harga=220000;
if(koduk=='l'||koduk=='L')
  strcpy(urjak,"M");
  harga=250000;
}
if(kojak=='2')
{
  strcpy(merjak,"Polo");
if(koduk=='s'||koduk=='S')
  strcpy(urjak,"S");
  harga=100000;
if(koduk=='m'||koduk=='M')
  strcpy(urjak,"M");
  harga=150000;
if(koduk=='l'||koduk=='L')
  strcpy(urjak,"M");
  harga=200000;
}
total=(jumbel*harga);

clrscr();

cout<<"\t\t\t============================================"<<endl;
cout<<"\t\t\t\t  JAKET SERBA NYAMAN\n";
cout<<"\t\t\t============================================"<<endl;
cout<<"Nama Pembeli  :"<<napem;cout<<"\t\tNo Tlp :"<<notel<<endl;
cout<<"==============================================="<<endl;
cout<<"Pilihan Kode Jaket :\n";
cout<<"\t\t    1. Untuk Kode Jaket Eiger\n";
cout<<"\t\t    2. Untuk Kode Jaket Polo\n";
cout<<"==============================================="<<endl;
cout<<"Kode Jaket    :"<<kojak<<endl;
cout<<"Ukuran Jaket  :"<<urjak<<endl;
cout<<"Jumlah Beli   :"<<jumbel<<endl;
cout<<"Merk Jaket    :"<<merjak<<endl;
cout<<"Harga Jaket   :"<<harga<<endl;
cout<<"======================"<<endl;
cout<<"Total Bayar   :"<<total<<endl;
cout<<"Bayar         :";cin>>bayar2;
cout<<"======================"<<endl;
kembal=bayar2-total;
cout<<"Kembalian     :"<<kembal<<endl;
cout<<"======================";
cout<<"\nINGIN INPUT LAGI [Y/T] : "; cin>>lagi;
if(lagi == 'y' || lagi == 'Y')
goto awal;
else
cout<<"\t\t\t\t============================="<<endl;
cout<<"\t\t\t\t  TERIMA KASIH SEMOGA AWET"<<endl;
cout<<"\t\t\t\t============================="<<endl;
getch();
}
==========================================================================

Tidak ada komentar:

Posting Komentar