#include "conio.h"
#include "iostream.h"
#include "stdio.h"
#include "string.h"
struct barang{
int kode;
int jumlah;
}rproduk[40];
void main(){
int i=0,j;
char lg;
char nama[20];
long harga;
long total;
do{
gotoxy(10,5);cout << "Input Data Penjualan";
gotoxy(10,6);cout << "--------------------";
gotoxy(10,7);cout << "Kode : ";cin >> rproduk[i].kode;
gotoxy(10,9);cout << "Jumlah : ";cin >> rproduk[i].jumlah;
gotoxy(10,10);cout << "Input lagi[Y/T] : ";cin >> lg;
clrscr();i++;
}while(lg=='Y' || lg=='y');
gotoxy(5,2);cout << "Laporan Data Penjualan";
gotoxy(5,3);cout << "---------------------------------------------------------";
gotoxy(5,4);cout << "No Kode Nama Barang Harga Jumlah Total Harga";
gotoxy(5,5);cout << "---------------------------------------------------------";
for (j=0;j<i;j++){
switch(rproduk[j].kode){
case 1:
strcpy(nama,"TV");
harga=1000000;
break;
case 2:
strcpy(nama,"DVD");
harga=650000;
break;
case 3:
strcpy(nama,"CD ROOM");
harga=400000;
break;
default:strcpy,"--";harga=0;
}
gotoxy(5,6+j);cout << j+1 << " ";
gotoxy(9,6+j);cout << rproduk[j].kode << " ";
gotoxy(15,6+j);cout << nama;
gotoxy(28,6+j);cout << "Rp ";
gotoxy(31,6+j);cout << harga;
gotoxy(46,6+j);cout << rproduk[j].jumlah << " ";
total=harga*rproduk[j].jumlah;
gotoxy(51,6+j);cout << "Rp. ";
gotoxy(54,6+j);cout << total;
}
gotoxy(5,7+j);cout << "---------------------------------------------------------";
}
#include "iostream.h"
#include "stdio.h"
#include "string.h"
struct barang{
int kode;
int jumlah;
}rproduk[40];
void main(){
int i=0,j;
char lg;
char nama[20];
long harga;
long total;
do{
gotoxy(10,5);cout << "Input Data Penjualan";
gotoxy(10,6);cout << "--------------------";
gotoxy(10,7);cout << "Kode : ";cin >> rproduk[i].kode;
gotoxy(10,9);cout << "Jumlah : ";cin >> rproduk[i].jumlah;
gotoxy(10,10);cout << "Input lagi[Y/T] : ";cin >> lg;
clrscr();i++;
}while(lg=='Y' || lg=='y');
gotoxy(5,2);cout << "Laporan Data Penjualan";
gotoxy(5,3);cout << "---------------------------------------------------------";
gotoxy(5,4);cout << "No Kode Nama Barang Harga Jumlah Total Harga";
gotoxy(5,5);cout << "---------------------------------------------------------";
for (j=0;j<i;j++){
switch(rproduk[j].kode){
case 1:
strcpy(nama,"TV");
harga=1000000;
break;
case 2:
strcpy(nama,"DVD");
harga=650000;
break;
case 3:
strcpy(nama,"CD ROOM");
harga=400000;
break;
default:strcpy,"--";harga=0;
}
gotoxy(5,6+j);cout << j+1 << " ";
gotoxy(9,6+j);cout << rproduk[j].kode << " ";
gotoxy(15,6+j);cout << nama;
gotoxy(28,6+j);cout << "Rp ";
gotoxy(31,6+j);cout << harga;
gotoxy(46,6+j);cout << rproduk[j].jumlah << " ";
total=harga*rproduk[j].jumlah;
gotoxy(51,6+j);cout << "Rp. ";
gotoxy(54,6+j);cout << total;
}
gotoxy(5,7+j);cout << "---------------------------------------------------------";
}
Tidak ada komentar:
Posting Komentar