Please do not use vectors or any previously posted code Write a C++ program which reads...

60.1K

Verified Solution

Question

Programming

Please do not use vectors or any previously posted code

Write a C++ program which reads in a list of process names andinteger times from stdin/cin and simulates round-robin CPUscheduling on the list. The input is a list of lines eachconsisting of a process name and an integer time, e.g.

ProcessA 4

ProcessB 10

Read line by line until an end-of-transmission (^d) isencountered. You should read the list and represent it in a linkedlist data structure. You should use the alarmsystem call to schedule a timer interrupt every 3 seconds. Theinterrupt handler should pick the next process from the processlist, write a message saying how much time it has left toexecute,

i.e.

ProcessA 4

Then update its time left to execute by subtracting 3 secondsand return it to the end of the queue. If the process had no timeleft to execute, you should write a message saying this

i.e.

ProcessA Finished

And delete this process from the linked list.

If there are no processes left to execute, write a messagesaying

No processes left

And terminate your program.

If further information is needed please specifically commentwhat is needed.

Answer & Explanation Solved by verified expert
3.7 Ratings (606 Votes)
include include include include using namespace    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students