Aliabdat's Blog

Just another WordPress.com weblog

Tugas flowchart 12.1d.13

December 4, 2009 Posted by | Uncategorized | 2 Comments

Tugas program SURGA BUKU

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
char *nama, kode [10];
int  harga, jml, total = 0, buku_gratis;

clrscr();

cout << “SURGA BUKU” << endl;
cout << “masukan kode barang:”; cin >> kode;
cout << “jumlah barang:”; cin >> jml;

if(!strcmp(kode,”BRG01″))
{
nama=”buku 01″;
harga=10000;
total=jml*harga;
if(total<=100000)
{
buku_gratis=15000;
}

}
else if(!strcmp(kode,”BRG02″))
{
nama=”buku 02″;
harga=20000;
total=jml*harga;
if(total>100000 && 151000>total)
{
buku_gratis=25000;
}
}
else
{
nama=”buku 03″;
harga=30000;
total=jml*harga;
if(total>151000)
{
buku_gratis=40000;
}
}

cout << “nama barang:” << nama << endl;
cout << “harga barang:”<< harga << endl;
cout << “total:”<< total << endl;
cout << “buku gratis:”<< buku_gratis << endl;
getch();

}

December 4, 2009 Posted by | Uncategorized | Leave a Comment

   

Follow

Get every new post delivered to your Inbox.