943,832 Members | Top Members by Rank

Ad:
Jul 19th, 2004
0

i need a code for first come first serve simulation using visual basic

Expand Post »
:cry: i need a code for first come first serve simulation based on vb programming :rolleyes:
Last edited by mark johnson; Jul 19th, 2004 at 12:18 am. Reason: to be more specific
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mark johnson is offline Offline
1 posts
since Jul 2004
Jul 19th, 2004
0

Re: i need a code for first come first serve simulation using visual basic

Hello,

This is the C++ forum; your request involves Visual Basic, and that is why I moved the post to that forum.

It is also the rule at DaniWeb that we do not do your homework; we will help debug your code, we will help you design your program, but we cannot supply you the completed project. That is unethical for you to ask, and unethical for us to provide.

Please provide your information, and we can get to work with you. As I am not a vb programmer, I will have little else to say.

Christian
Team Colleague
Reputation Points: 121
Solved Threads: 57
Posting Virtuoso
kc0arf is offline Offline
1,629 posts
since Mar 2004
Jul 19th, 2004
0

Re: i need a code for first come first serve simulation using visual basic

Quote originally posted by mark johnson ...
:cry: i need a code for first come first serve simulation based on vb programming :rolleyes:
This sounds extraordinarily like homework. Why not post what you have already done and maybe we can help when it looks like you've had a try yourself.
Reputation Points: 16
Solved Threads: 1
Posting Whiz in Training
mnemtsas is offline Offline
200 posts
since Jul 2004
May 24th, 2009
0

Re: i need a code for first come first serve simulation using visual basic

Write down what you want the scenario to be -
For each person in the line,
serve first person only
next

Convert it to code
Reputation Points: 33
Solved Threads: 27
Posting Whiz
Jupiter 2 is offline Offline
372 posts
since May 2009
Jan 18th, 2010
-2
Re: i need a code for first come first serve simulation using visual basic
#include<stdio.h>
main()


{
float avgwt,avgtt;
char pname[10][10],c[10][10];
int wt[10],tt[10],bt[10],at[10],t,q,i,n,sum=0,sbt=0,ttime,j,ss=0;
printf("\n\nEnter the number of processes:");
scanf("%d",&n);
printf("\n\n Enter the NAME, BURST TIME and ARRIVAL TIME of thr process");
for(i=0;i<n;i++)


{
printf("\n\nNAME : ");
scanf("%s",&pname[i]);
printf("\n\nBURST TIME : ");
scanf("%d",&bt[i]);
printf("\n\n ARRIVAL TIME :");
scanf("%d",&at[i]);
}
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)


{
if(at[i]>at[j])


{
t=at[i];
at[i]=at[j];
at[j]=t;
q=bt[i];
bt[i]=bt[j];
bt[j]=q;
strcpy(c[i],pname[i]);
strcpy(pname[i],pname[j]);
strcpy(pname[j],c[i]);
}
}
wt[0]=0;
for(i=0;i<n;i++)


{
wt[i+1]=wt[i]+bt[i];
sum=sum+(wt[i+1]-at[i]);
tt[i]=wt[i]+bt[i];
ss=ss+bt[i];
}
avgwt=(float) sum/n;
avgtt=(float) sbt/n;
printf("\n\nAverage waiting time=%f",avgwt);
printf("\n\nAverage turn-around time=%f",avgtt);
printf("\n\n GANTT CHART\n");
for(i=0;i<n;i++)


{printf("|\t%s\t",pname[i]);
}
printf("\n");
for(i=0;i<n;i++)


{
printf("%d\t\t",wt[i]);
}
printf("%d\n",ss);
printf("\n");
}
Reputation Points: 6
Solved Threads: 0
Newbie Poster
shamila kaatnam is offline Offline
1 posts
since Jan 2010
Feb 19th, 2010
0
Re: i need a code for first come first serve simulation using visual basic
please post explanation about the code that you've shown/post
Reputation Points: 10
Solved Threads: 0
Newbie Poster
emilycox08@yaho is offline Offline
1 posts
since Feb 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Visul Basic Help
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Seriously need help now..pls help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC