Sabtu, 24 April 2010

Tugas C++

#include < stdio.h >
#include < conio.h >
#include < iostream.h >
main ()
{
char kode,*merk,kd_type,*type;
int harga,kembali;
int jumlah;
long total,uang_bayar;
//input
cout<<"TOKO SEJAHTERA SELALU \n";
cout<<"Menyediakan Berbagai Macam TV \n";
cout<<"_________________________________\n";
cout<<"Masukan Kode TV :";cin>>kode;
if (kode == 'A' || kode == 'a')
{
merk = "SAMSUNG";
if(kd_type=='1')
{
type = "14 inch";
harga = 800000;
}
else
//merk = "SAMSUNG";
if(kd_type=='2')
{type = "21 inch";
harga = 1200000;}
else
//merk = "SAMSUNG";
//if(kd_type=='3')
{
type = "29 inch";
harga = 2100000;}

}
else
if (kode == 'B' || kode == 'b')
{
merk = "LG";
if(kd_type=='1')
{type = "14 inch";
harga = 900000;}
else
merk = "LG";
if(kd_type=='2')
{type = "21 inch";
harga = 1350000;}
else
merk = "LG";
if(kd_type=='3')
{type = "29 inch";
harga = 2400000;}
}

//proses
//cout<<" jumlah :";cin>>jumlah;
// total = harga*jumlah;
//kembali = uang_bayar-total;

cout<<"Kode Type :";cin>>kd_type;
cout<<"_________________________________\n";
cout<<"Merk TV :"< cout<<"Type TV :"< cout<<"Harga TV :"< cout<<"jumlah :";cin>>jumlah;
cout<<"_________________________________\n";
total = harga*jumlah;
cout<<"Total Bayar :"< cout<<"Uang Bayar :";cin>>uang_bayar;
kembali=uang_bayar-total;

cout<<"Kembali :"< getch ();
}

Tampilannya:

Jumat, 19 Maret 2010

butuh lowongan kerja nich!