PBO Emi
PBO Emi
PBO Emi
NIM :2136099
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void garis() {
printf("=====================================================\n");
}
void bintang() {
printf("*****************************************************\n");
}
void minimarket() {
printf("-------------PROGRAM PENJUALAN MINIMARKET------------\n");
}
int main() {
int i, j;
char kode_k, kasir[20], lagi;
long int total_byr = 0, bayar, kembali;
char kode_brg[30];
char barang[30][20];
int harga[30] = {0};
int jml_bel[30];
long int sub_total[30];
atas:
garis();
bintang();
minimarket();
bintang();
garis();
printf("KODE KASIR\n");
printf(" 1. Adit\n");
printf(" 2. Bayu\n");
printf("Masukkan Kode Kasir[1/2] : ");
scanf(" %c", &kode_k);
fflush(stdin);
switch (kode_k) {
case '1':
strcpy(kasir, "Adit");
break;
case '2':
strcpy(kasir, "Bayu");
break;
default:
strcpy(kasir, "Kode Salah");
break;
}
printf("Jumlah item : ");
scanf("%d", &j);
fflush(stdin);
minimarket();
printf("KODE BARANG\n");
garis();
printf("1. Shampoo [S]\n");
printf("2. Sikat Gigi [G]\n");
printf("3. Sabun Mandi [M]\n");
garis();
printf("\n");
for (i = 1; i <= j; i++) {
printf("Data Ke-%d\n", i);
printf("Kode Barang : ");
scanf(" %c", &kode_brg[i]);
fflush(stdin);
printf("Jumlah Beli : ");
scanf("%d", &jml_bel[i]);
fflush(stdin);
garis();
}
for (i = 1; i <= j; i++) {
if (kode_brg[i] == 'S' || kode_brg[i] == 's') {
strcpy(barang[i], "Shampoo");
harga[i] = 15000;
}
else if (kode_brg[i] == 'G' || kode_brg[i] == 'g') {
strcpy(barang[i], "Sikat Gigi");
harga[i] = 5000;
}
else if (kode_brg[i] == 'M' || kode_brg[i] == 'm') {
strcpy(barang[i], "Sabun Mandi");
harga[i] = 9000;
}
else {
strcpy(barang[i], "Kode Salah");
harga[i] = 0;
}
}
garis();
printf(" TOKO BERSIH\n");
printf(" Jl. Jendral Sudirman No. 123\n");
printf(" Jakarta Selatan\n");
garis();
printf("Kasir : %s\n", kasir);
printf("-----------------------------------------------------\n");
printf("No | Barang | Harga | Jumlah | Subtotal\n");
printf("-----------------------------------------------------\n");
#include<conio.h>
#include<stdio.h>
#include<iostream>
#include<windows.h>
using namespace std;
int main(){
char kj,ku,*uk,*jns;
float hrg,jml,tot,ukemb,ubyr;
{ ulang:
system("cls");
cout<<" ------------Toko Maju Jaya------------"<<endl;
cout<<"*****[PILIHAN PRODUK]*****"<<endl;
cout<<"A.Susu dancow"<<endl;
cout<<"B.Susu bendera"<<endl;
cout<<"C.Susu SGM"<<endl;
cout<<"0.Program Keluar"<<endl;
cout<<"*****************************"<<endl;
case'B': case'b':
{ uk="kecil"; hrg=15000; }
cout<<"Harga =Rp."<<hrg<<endl;
tot=hrg*jml;
=Rp."<<ukemb<<endl;
menulagi :
3. Penjualan kue
#include <iostream>
using namespace std;
int main ()
{
char namapembeli[20],kodekue[20],namakue[20];
}
Outputnya
Outputnya
Outputnya