/*PROGRAM TO GENERATE GANTT CHART FOR PROCESS TIMING*/ #include #include #include #include #include #define MAXNUMP 49 #define TOPDROP 200 #define TROUGHHEIGHT 50 #define TROUGHLENGTH 500 void initialize(void); void drawganttchart(int [],int ,int ,float ); void restore(void); int color=1; void main() { int i,n; int prtime[50],waittime[50]; float totwaittime,avgtime; char choice,col; clrscr(); cout<'2'; ) choice=getch(); cout<=50; ) { cin>>n; if(n<=0||n>=MAXNUMP) cout<<"Value should be between 1 & "<>prtime[i]; } break; default: break; } for(i=0,waittime[0]=0;i11) fillstyle=1; if(color==1) setfillstyle(fillstyle,i+1); else setfillstyle(fillstyle,WHITE); perdis=((float)prtime[i]/tot)*100; blocklength=(TROUGHLENGTH*perdis)/100; currstart=currstart+blocklength; bar(dragstart+1,TOPDROP+1,currstart+1,TOPDROP+TROUGHHEIGHT-1); line(currstart,TOPDROP,currstart,TOPDROP+TROUGHHEIGHT); itoa(waittime,q,10); if(currstart>(dragstart+textwidth(q))) outtextxy(dragstart,TOPDROP+TROUGHHEIGHT+5,q); } rectangle((maxx-TROUGHLENGTH)/2,TOPDROP,maxx-(maxx-TROUGHLENGTH)/2,TOPDROP+TROUGHHEIGHT); if(currstart