#include <iostream>
#include <string.h>
using namespace std;
int GetKey();
int SearchInv (int keyVal,int prodID[]);
void PrintData(int foundSub, int prodID[], int numItem[],
float price[],int reorder[],char namaBarang[][15]);
const int INV = 10;
int main()
{
int prodID[INV] = {32,45,76,10,94,52,27,29,87,60};
int numItem[INV] = {6,2,1,0,8,2,4,7,9,3};
char namaBarang[INV][15]={"Sabun","Minyak","Kain","Garam","Gula","Beras",
"Mentega","Kacang Tanah","Lemari","Meja"};
float price [INV] = {5.43,6.78,8.64,3.32,1.92,7.03,9.87,7.65,4.63,2.83};
int reorder[INV] = {5,4,1,3,5,6,2,1,1,4};
int keyVal,foundSub;
keyVal = GetKey();
foundSub = SearchInv(keyVal,prodID);
if (foundSub == -99)
{
cout<<"Product Tidak ada dalam daftar inventory \n\n";
//return;
}
PrintData(foundSub,prodID,numItem,price,reorder,namaBarang);
//return;
}
int GetKey()
{
int keyVal;
cout<<"** Program Mencari inventory **"<<endl;
cout<<endl<<endl<<"Masukkan ID Product : ";
cin>>keyVal;
return(keyVal);
}
int SearchInv(int keyVal,int prodID[])
{
int foundSub = -99;
int c;
for (c=0;c < INV;c++)
{
if(keyVal==prodID[c])
{foundSub = c; break;}
}
return(foundSub);
}
void PrintData( int foundSub,int prodID[],int numItem[],
float price[],int reorder[],char namaBarang[][15])
{
cout.precision(2);
cout.setf(ios::showpoint);
cout.setf(ios::fixed);
char NamaBarang[15];
for(int i=0;i<15;i++)
NamaBarang[i]=namaBarang[foundSub][i];
cout<<endl<<"ID Product: "<<prodID[foundSub]<<"\nNama Barang: "
<<NamaBarang<<endl<<"Jumlah stok: "<<numItem[foundSub]<<endl;
cout<<"Harga : $"<<price[foundSub]<<"\tPesanan: "
<<reorder[foundSub]<<endl<<endl;
return;
}
ini saya kasing link download yg sudah jadi :
Klik ==> Klik download <== Klik
SEARCH
LATEST
3-latest-65px
Pengunjung
Categories
Refensi
(30)
Assistant of Laboratory
(18)
Linux
(13)
Keamanan Jaringan
(12)
bitcoin
(10)
Tip dan trik
(9)
Toko
(6)
Umsida
(6)
CCNA
(5)
C++
(4)
Driver
(3)
Materi
(3)
Rasberry Pi
(3)
Hardware
(2)
Uang
(2)
hadist
(2)
Kata-Kata
(1)
Keygen
(1)
Konfrimasi
(1)
adsense
(1)
mining
(1)
proxy
(1)
ranni
(1)