•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 391,591 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,680 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 1694 | Replies: 4
![]() |
•
•
Join Date: Apr 2005
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
hi alll
am a new member of this this amazing community and feel good to be part of it.i required help regarding simulation of multilevel feedback queue.i have checked many samples of scheduling but couldnt got right...so can any body help me?? code of this simulation should be in c/c++ ,java/java script...i would be really thankful.last date of project is 27-04-2005
waitin for your reply...really lookin forward to you guys!!!!!
falak
am a new member of this this amazing community and feel good to be part of it.i required help regarding simulation of multilevel feedback queue.i have checked many samples of scheduling but couldnt got right...so can any body help me?? code of this simulation should be in c/c++ ,java/java script...i would be really thankful.last date of project is 27-04-2005
waitin for your reply...really lookin forward to you guys!!!!!
falak
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,134
Reputation:
Rep Power: 10
Solved Threads: 257
•
•
Join Date: Apr 2005
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<string.h>
void mainmenu();
class queue
{
private:
int timequan,prior;
public:
void rrobin();
void fcfs();
};
void queue :: rrobin()
{
cout<<"Please Enter The Priority For This Queue"<<endl;
cin>>prior;
while(1)
{
if(prior==1&&prior==2)
{
timequan=2;
cout<<"Time Quantum For This Queue is "<<timequan<<endl;
break;
}
if(prior==3&&prior==4)
{
timequan=4;
cout<<"Time Quantum For This Queue is "<<timequan<<endl;
break;
}
else
{
cout<<"Please Enter Valid Priority Between 1-5 "<<endl;
break;
}
}
void queue :: fcfs()
{
prior=5;
cout<<"This Queue Has Fixed Priority"<<prior<<endl;
}
class process
{
private:
int pno,pbtime,pprior,parrival,pwait,ptat;
char pid[10];
public:
queue(){pno=pbtime=pprior=parrival=pwait=ptat=pid[10]=0;}
queue(int n,char id[],int btime,int prior,int arrival,int wait,int tat)
{
pno=n;
pbtime=btime;
parrival=arrival;
pwait=wait;
ptat=tat;
pprior=prior;
strcpy(pid,id);
}
void getdata();
void showdata();
};
void process :: getdata()
{
cout<<"\nPlease Enter No Of Processes ";
cin>>pno;
cin.ignore(10,'\n');
cout<<"\nPlease Enter Process Id ";
cin.get(pid,'10');
cout<<"\nPlease Enter Process Priority ";
cin>>pprior;
cout<<"\nPlease Enter Process Burst Time ";
cin>>pbtime;
cout<<"\nPlease Enter Process Arrival Time ";
cin>>parrival;
}
void process :: showdata()
{
cout<<"\nProcess No "<<pno<<endl;
cout<<"\nProcess ID "<<pid<<endl;
cout<<"\nProcess Priority "<<pprior<<endl;
cout<<"\nProcess Burst Time "<<pbtime<<endl;
cout<<"\nProcess Wait Time "<<pwait<<endl;
cout<<"\nProcess Arrival Time "<<parrival<<endl;
cout<<"\nProcess Turn Around Time "<<ptat<<endl;
}
void main()
{
int total,i,choice;
process p[i];
textmode(3);
while(1)
{
mainmenu();
gotoxy(17,17);
cout<<"Please Enter Your Choice ";
cin>>choice;
switch(choice)
{
case 1:
clrscr();
cout<<"Please Enter The Total Number Of Processes ";
cin>>total;
for (i=1;i<=total;i++)
p[i].getdata();
getch();
break;
case 2:
clrscr();
for (i=1;i<=total;i++)
p[i].showdata();
getch();
break;
case 3:
exit(0);
default:
gotoxy(17,19);
cout<<"Please Enter The Correct Choice";
getch();
continue;
}
}
getche();
}
void mainmenu()
{
clrscr();
cout<<" \n\n\t\t\tMain Menu"<<endl;
cout<<"\n\t\t1.Insert Process"<<endl;
cout<<"\n\t\t2.Display Processes"<<endl;
cout<<"\n\t\t3.Exit"<<endl;
}![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
- Advertise on popular young programmers community [footer links too!] (Ad Space for Sale)
- Advertise on popular young programmers community (Ad Space for Sale)
- Needed: Miva Merchant Gurus, PHP, Flash, Graphics, Web programmers. Project Managers (Web Development Job Offers)
- Talkfreelance.com, Community for designers & programmers! (Post your Resume)
- Looking for amateur programmers! (Software Development Job Offers)
- An useful image tool for programmers,artists and normal users (Windows Software)
- Need 2 c++ programmers (C++)
Other Threads in the C++ Forum
- Previous Thread: Wierd Numbers appear when trying to run a running product in a C++ program
- Next Thread: updating the screen



Linear Mode