#include <stdlib.h>
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
char kb, nb;
int stuan, jb, tb, hb;
float th, pot,tot;
printf("--------------------------------------------------------------\n");
printf("\t \t MINI MARKET SERBA ADA \n");
printf("--------------------------------------------------------------\n");
//input
printf("Kode Barang \t : ");scanf("%s",&kb);
printf("Nama Barang \t : ");scanf("%s",&nb);
printf("Satuan \t \t : ");scanf("%i",&stuan);fflush(stdin);
printf("Jumlah Beli \t : ");scanf("%10.i",&jb);fflush(stdin);
printf("Harga Beli \t : ");scanf("%i",&hb);fflush(stdin);
printf("--------------------------------------------------------------\n");
th = jb * (float)hb;
printf("Total Harga \t : Rp. %10.2f \n ",th);
if(th > 100000)
{
pot =0.1*th;
}
else
{
pot=0;
}
printf("Potongan \t : Rp. %10.2f \n ",pot);
printf("--------------------------------------------------------------\n");
tot = th-pot;
printf ("Total Bayar \t : Rp. %10.2f \n ",tot);
printf("--------------------------------------------------------------\n");
getch();
return 0;
}
A Short Description about youself
Any feedback, questions or ideas are always welcome. In case you are posting Code ,then first escape it using Postify and then paste it in the comments
0 comments: