Selasa, 20 April 2010

Nama : Winarto

Nim : 12074252

Kls : 12.6G.03.A

#include

#include

#include

main()

{

char kode,kd_type,*type,*jenis;

int jumlahbeli;

long harga,total,uangbayar,kembali;

cout <

cout <<"Lab c sore \n";

cout <<"________________________\n";

cout <<"masukan kode HP [A/B/C]=";cin>>kode;

cout <<"masukan type HP[1/2/3]\t=";cin>>kd_type;

cout <<"jumlah beli\t\t=";cin>>jumlahbeli;

cout <<"________________________\n";

if (kode == 'A'|| kode =='a')

{

jenis="Nokia";

if (kd_type=='1')

{

type="N70";

harga=1000000;

}

else

if (kd_type== '2')

{

type="N76";

harga=2000000;

}

else

if (kd_type== '3')

{

type="N80";

harga=2500000;

}

}

else

if (kode == 'B'|| kode =='b')

{

jenis="Soni Ericson";

if (kd_type=='1')

{

type="k500i";

harga=800000;

}

else

if (kd_type== '2')

{

type="k550i";

harga=1000000;

}

else

if(kd_type== '3')

{

type="k750i";

harga=1200000;

}

}

else

if(kode == 'C'|| kode =='c')

{

jenis="Esia";

if (kd_type=='1')

{

type="esia Ngoceh";

harga=200000;

}

else

if (kd_type== '2')

{

type="Esia warna";

harga=300000;

}

else

if(kd_type== '3')

{

type="Esia Online";

harga=500000;}

}

cout <<"Merk HP ="<<

cout <<"type HP ="<<

cout <<"Harga Hp="<<

cout <<"-----------------------\n";

total=jumlahbeli*harga;

cout <<"Total Bayar="<<

cout <<"Uang Bayar =";cin>>uangbayar;

kembali=uangbayar-total;

cout <<"Kembali =Rp"<<

cout <<"--------------------\n";

cout <<"TERIMA KASIH\n";

getch();

}

//out put