Senin, 23 Mei 2016

Kombinasi for dan do .. while

Kombinasi for dan do .. while

Nota Pembayaran
Nota Pembayaran
Program :
#include <iostream.h>
#include <conio.h>
#include <iomanip.h>

//gatewan.com -- Wawan Beneran
//NOTA PEMBAYARAN

void main()
{
cout<<"NOTA PENJUALAN\n";
cout<<"GATEWAN MARKET\n";
cout<<"Jl. Parangtritis No 10 Yogyakarta\n";
cout<<"===================================================================\n";
cout<<"| No. | Nama Barang | Jml | Hg Sat | Jml Hg | Diskon | Tot Hg |\n";
cout<<"===================================================================\n";
for(int i=1;i<=15;i++)
{
cout<<"|                                                                  |\n";
}
cout<<"===================================================================\n";
cout<<"| TOTAL Bayar \n";
cout<<"===================================================================\n";
int i=1; char jw;
float jml,hgsat,jmlhg,disk,hgdisk,totdisk,totsemua,tothg;
char nmbrg[30];
do
{
gotoxy(3,6+i);cout<<i;
gotoxy(8,6+i);cin>>nmbrg;
gotoxy(22,6+i);cin>>jml;
gotoxy(28,6+i);cin>>hgsat;
jmlhg=jml*hgsat;
gotoxy(37,6+i);cout<<jmlhg;
gotoxy(46,6+i);cin>>disk;
hgdisk=(disk/100)*jmlhg;
gotoxy(50,6+i);cout<<hgdisk;
tothg=jmlhg-hgdisk;
totdisk=totdisk+hgdisk;
totsemua=totsemua+tothg;
gotoxy(55,6+i);cout<<tothg;
gotoxy(50,23);cout<<totdisk;
gotoxy(55,23);cout<<totsemua;
gotoxy(30,1);cout<<"Input data lagi [y/t]? ";cin>>jw;
i++;
gotoxy(30,1);clreol();
}while(jw=='y');
getch();
}
 
reff : http://www.gatewan.com/2015/02/koleksi-program-perulangan-c.html 

1 komentar :

http://www.resepkuekeringku.com/2014/11/resep-donat-empuk-ala-dunkin-donut.html http://www.resepkuekeringku.com/2015/03/resep-kue-cubit-coklat-enak-dan-sederhana.html http://www.resepkuekeringku.com/2014/10/resep-donat-kentang-empuk-lembut-dan-enak.html http://www.resepkuekeringku.com/2014/07/resep-es-krim-goreng-coklat-kriuk-mudah-dan-sederhana-dengan-saus-strawberry.html http://www.resepkuekeringku.com/2014/06/resep-kue-es-krim-goreng-enak-dan-mudah.html http://www.resepkuekeringku.com/2014/09/resep-bolu-karamel-panggang-sarang-semut-lembut.html

Copyright © Pemrograman Terstruktur | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com | BTheme.net        Up ↑