Jumat, 17 Juni 2011

tugas 6 c++

#include<constrea.h>
#include<stdio.h>
class jual
{
public:
char kode_hp[5],*merk_hp;
int jml_beli;
float harga,total;
};
main()
{
char nm_kasir[25],nm_pembeli[25];
int i,j;
float totbay;
jual hp[10];
clrscr();
cout<<" KONOHA CELL "<<endl;
cout<<" Jl. Kalibata Timur No.37 "<<endl;
cout<<" Telp. (021) 7901074 "<<endl;
cout<<"-------------------------------------------------------------"<<endl;
cout<<"Nama kasir : ";gets(nm_kasir);
cout<<"Nama pembeli : ";gets(nm_pembeli);
cout<<"Masukkan jumlah data : ";cin>>j;
cout<<endl;
for(i=1;i<=j;i++)
{
cout<<"Data ke- "<<i<<endl;
cout<<"Kode Hp [NK66,SE80,NK73,SM73] :";cin>>hp[i].kode_hp;
if(strcmpi(hp[i].kode_hp,"NK66")==0)
{hp[i].merk_hp="Nokia 6600";
hp[i].harga=1200000;}
else
if(strcmpi(hp[i].kode_hp,"SE80")==0)
{hp[i].merk_hp="Sony Ericson W80";
hp[i].harga=1500000;}
else
if(strcmpi(hp[i].kode_hp,"NK73")==0)
{hp[i].merk_hp="Nokia N73";
hp[i].harga=1700000;}
else
if(strcmpi(hp[i].kode_hp,"SM73")==0)
{hp[i].merk_hp="Siemens C73";
hp[i].harga=1700000;}

DOWNLOAD


Tidak ada komentar:

Posting Komentar