Program C++ Sederhana


D2 TEKNIK KOMPUTER (BSI PROGRAMMER)




#include
#include
#include
struct
{
char nape[10],kode,almt,*nabar;
int ambil,harga;
}rhyndy[20];


int i,j,tobay;
long int total=0;

main()
{
clrscr();
cout<<"\tBSI EXPRESS"<cout<<"\tJalan Raya Kalimalang"<cout<<"==================================="<cout<<"Kode Barang :  1.Elektronik"<cout<<"Kode Barang :  2.Makanan"<cout<<"Kode Barang :  3.Sandang bukan sanfang...(koreksi)"<cout<<"Banyaknya Data :";cin>>j;
cout<clrscr();
for(i=1;i<=j;i++)
{
clrscr();
cout<<"Data ke"<cout<<"\t Nama Pengirim Barang            :";cin>>rhyndy[i].nape;
cout<<"\t Jumlah Barang yang akan dikirim :";cin>>rhyndy[i].ambil;
cout<<"\t Kode Jenis Barang               :";cin>>rhyndy[i].kode;
cout<<"\t Alamat Tujuan                   :";cin>>rhyndy[i].almt;
clrscr();
if(rhyndy[i].kode=='1')
   {
   rhyndy[i].nabar="Elektronik";rhyndy[i].harga=50000;
   }
else if(rhyndy[i].kode=='2')
   {
   rhyndy[i].nabar="Makanan";rhyndy[i].harga=15000;
   }
else

{rhyndy[i].nabar="Sandang";rhyndy[i].harga=35000;}

total=rhyndy[i].ambil*rhyndy[i].harga;
}
clrscr();
cout<<"\t      BSI EXPRESS           "<cout<<"\t      Jalan KaliMalang Raya  "<cout<<"###############################################################"<cout<<"No   Nama       Nama         Jenis       Jumlah     Biaya           Total"<cout<<"     Pengirim   Barang       Barang      Data       Kirim           Penjualan"<cout<<"============================================================================="<    //12345678901234567890123456789012345678901234567890123456789012345678901234567890//
for(i=1;i<=j;i++)
{
gotoxy(2,7+i);cout<gotoxy(7,7+i);cout<gotoxy(18,7+i);cout<gotoxy(31,7+i);cout<gotoxy(43,7+i);cout<gotoxy(54,7+i);cout<gotoxy(70,7+i);cout<tobay = tobay+total;
}

cout<<"\n======================================================================"<cout<cout<<"Total Pembayaran                         = "<
getch();

}


Screen Shut Program : 






Posting Komentar

Please Select Embedded Mode To Show The Comment System.*

Lebih baru Lebih lama