menghitung hasil total penjualan dengan c++ berupa tabel

berikut ini  rumus pada c++ untuk menghitung dan menampilkan total hasil penjualan, dengan berbagai barang yang di inputkan berupa tabel hasil akhirrrr..

=====rumus#1=====

 

#include <iostream.h>

#include <conio.h>

void main ()

{

int i;

char nbrg[30];

int jmlb;

int hgs;

int total;

cout<<“Masukkan 5 Data”;

gotoxy(2,3);cout<<“======================================================”;

gotoxy(2,4);cout<<“!”;

gotoxy(4,4);cout<<“NO”;

gotoxy(7,4);cout<<“!”;

gotoxy(9,4);cout<<“Nama Barang”;

gotoxy(23,4);cout<<“Jml Beli”;

gotoxy(21,4);cout<<“!”;

gotoxy(32,4);cout<<“!”;

gotoxy(34,4);cout<<“Hg Satuan”;

gotoxy(44,4);cout<<“!”;

gotoxy(46,4);cout<<“Total Hg”;

gotoxy(55,4);cout<<“!”;

gotoxy(2,5);cout<<“======================================================”;

for(int i=1; i<=5; i++)

{

gotoxy(4,5+i);cout<<i;

gotoxy(2,5+i);cout<<“!”;

gotoxy(7,5+i);cout<<“!”;

gotoxy(9,5+i);cin>>nbrg;

gotoxy(21,5+i);cout<<“!”;

gotoxy(26,5+i);cin>>jmlb;

gotoxy(32,5+i);cout<<“!”;

gotoxy(34,5+i);cin>>hgs;

gotoxy(44,5+i);cout<<“!”;

total=jmlb*hgs;

cout<<total<<endl;

gotoxy(55,5+i);cout<<“!”;

gotoxy(2,6+5);cout<<“=====================================================”;

}

getch();

}

 

========rumus#2=======

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

void main (){
int i,n;
char nbrg[30];
int jmlb;
int hgs;
int total;
int totals;

cout<<“Total pembayaran Barang \n”;
cout<<“Masukkan Jumlah Data: “;
cin>>n;

gotoxy(2,3);cout<<“======================================================”;
gotoxy(2,4);cout<<“|”;
gotoxy(4,4);cout<<“NO”;
gotoxy(7,4);cout<<“|”;
gotoxy(9,4);cout<<“Nama Barang”;
gotoxy(23,4);cout<<“Jumlah”;
gotoxy(21,4);cout<<“|”;
gotoxy(32,4);cout<<“|”;
gotoxy(34,4);cout<<“Harga”;
gotoxy(44,4);cout<<“|”;
gotoxy(46,4);cout<<“Total”;
gotoxy(55,4);cout<<“|”;
gotoxy(2,5);cout<<“======================================================”;
gotoxy(2,6+n);cout<<“======================================================”;
gotoxy(35,7+n);cout<<“Total”;
gotoxy(44,7+n);cout<<“:”;

for(int i=1; i<=n; i++)
{
gotoxy(4,5+i);cout<<i;
gotoxy(2,5+i);cout<<“|”;
gotoxy(7,5+i);cout<<“|”;
gotoxy(9,5+i);cin>>nbrg;
gotoxy(21,5+i);cout<<“|”;
gotoxy(32,5+i);cout<<“|”;
gotoxy(26,5+i);cin>>jmlb;
gotoxy(44,5+i);cout<<“|”;
gotoxy(34,5+i);cin>>hgs;
gotoxy(55,5+i);cout<<“|”;

total=jmlb*hgs;
gotoxy(46,5+i);cout<<total;
gotoxy(45,7+n);
totals=total++;
gotoxy(35,7+n);cout<<“Total”;
gotoxy(44,7+n);cout<<“:Rp.”;cout<<totals;
}

getch();}

by:TI.A/Era/2011

About irwantav

seperti yang anda lihat !!!

Posted on 28 Desember 2011, in c++. Bookmark the permalink. Tinggalkan komentar.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: