#include<conio>
#include<stdio>
#include<iostream>
#define awal{
#define akhir}
#define mulai()main()
#define cetak cout
#define masukan cin
#define tahan()getch()
#define pindah endl
mulai()
awal
int i,n;
struct
awal
char merk[10],kode[10];
int hrg,jumbel,ttl;
akhir mhs[10];
cetak<<"\t\t PENJUALAN SUSU ";pindah;
cetak<<pindah;
cetak<<"********************************************************";pindah;
cetak<<pindah;
cetak<<"MASUKKAN JUMLAH DATA :";masukan>>n;
for(i=1;i<=n;i++)
awal
cetak<<"MASUKAN DATA KE-:"<<i<<pindah;
cetak<<"MASUKAN KODE SUSU :";masukan>>mhs[i].kode;
cetak<<"MASUKAN JUMLAH BELI :";masukan>>mhs[i].jumbel;
akhir
for(i=1;i<=n;i++)
awal
if(!strcmp(mhs[i].kode,"D001")||!strcmp(mhs[i].kode,"d001"))
{
strcpy(mhs[i].merk,"DANCOW");
mhs[i].hrg=200000;
}
else
if(!strcmp(mhs[i].kode,"AL02")||!strcmp(mhs[i].kode,"al02"))
{
strcpy(mhs[i].merk,"ANLINE");
mhs[i].hrg=500000;
}
else
if(!strcmp(mhs[i].kode,"E103")||!strcmp(mhs[i].kode,"e103"))
{
strcpy(mhs[i].merk,"L-MEN");
mhs[i].hrg=300000;
}
cetak<<"\t\t PENJUALAN SUSU ";pindah;
cetak<<pindah;
cetak<<"********************************************************";pindah;
cetak<<pindah;
cetak<<"DATA KE- :"<<i<<pindah;
cetak<<"KODE SUSU :"<<mhs[i].kode<<pindah;
cetak<<"MERK SUSU :"<<mhs[i].merk<<pindah;
cetak<<"HARGA :"<<mhs[i].hrg<<pindah;
cetak<<"JUMLAH BELI :"<<mhs[i].jumbel<<pindah;
mhs[i].ttl=mhs[i].hrg*mhs[i].jumbel;
cetak<<"TOTAL HARGA :"<<mhs[i].ttl<<pindah;
akhir
tahan();
akhir
ehm..mantab
BalasHapus