#include
#include
#include
#include
#include
void view(int item, int x, int y){
if (item<10)
gotoxy(x,y);
else
gotoxy(x-1,y);
cout<
void line(int x, int y){
gotoxy(x,y);
cout<<"|"<
void inputan(int *sMi, int *sMa, int *sNo,int *tSi, int *a1, int *b1, int *n1, int *men1, int *men2){
cout<<"Inputkan"<
cin>>*sMi;
cout<<" Stok maksimal : ";
cin>>*sMa;
cout<<" Stok sekarang : ";
cin>>*sNo;
cout<<" Lama simulasi : ";
cin>>*tSi;
cout<<" Maksimal beli (besar demand maksimal) : ";
cin>>*a1;
cout<<" Minimal beli (besar demand minimal) : ";
cin>>*b1;
cout<<" Banyak demand yang datang : ";
cin>>*n1;
cout<<" Rata - rata waktu antar kedatangan demand : ";
cin>>*men1;
cout<<" Rata - rata selang waktu datang order : ";
cin>>*men2;
}
void main(){
ulang:
clrscr();
int sMin,sMax,sNow,tSim,a,b,Stok,cDem = 0,n,mean1,mean2;
cout<<" =^=^=^=^=^=^=^=^=^=^=^=^=^=^="<
typedef struct{
int value;
int iTime;
int tSent;
int tWait;
bool sent;
}id_demand;
int waktu;
id_demand demand[50];
int demCome;
float u,ran;
randomize();
for (int i=0; i
u = ((rand() % 10));
}while(u==0);
ran = u/10;
waktu = -1 * mean1 * log10(ran);
if (i==0){
demand[i].iTime = waktu;
}
else{
demand[i].iTime = demand[i-1].iTime + waktu;
}
demand[i].value = a + (b-a)*ran;
}
for (int j=0; j
}
int vOrder = 0;
int t=0;
bool order = false;
int i = 0;
int y = 16 + n;
int y2 = 8;
int dem,sDemWait = 0,tOrder,demSent,demWait,xtOrder = 0;
Download source code lengkap nya di sini
Label
- Adekdik Software (1)
- Aplikasi Iseng (16)
- C++ (7)
- Download (2)
- Excel (1)
- Google Map (1)
- Iseng (1)
- Nambah ilmu (32)
- Pascal (20)
- Super Iseng (2)
- VB .Net (21)
- VB 6 (1)
Rabu, 29 April 2009
Contoh program inventori dengan demand, time demand dan selang order random dengan C++
Label: C++
Langganan:
Posting Komentar (Atom)
1 komentar:
bos dimasukin juga donk cara buat databasenya... maklum amatiran
Posting Komentar