Computer Science Homework Solutions
Problem
#125176

Simulator of the states of processes in an operating system in C++

The program must be done in C++

The program is not in Visual C++, in other words it must show everything in the command prompt window.

Please use cout and cin and not printf and scanf nor other C standards

See attached file for full problem description.


Attached file(s):
Attachments
Simulator.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Simulator.doc
Simulator of the states of processes in an operating system

Phase# 1:

The first phase of the simulator will consist to develop effectively a
QUEUE, which is a data structure that does a FIFO. This READY QUEUE
must be capable of storing Process #, The time it will take to execute
the process (0 <= Num <=25) and the description of the process (Word,
Excel, Dev C++, etc.)

Process # Time required Process

1 18 Dev C++

2 3 Word Perfect

7 8 Flight Simulator

5 12 PowerPoint

9 7 Netscape

Hint: Create a QUEUE where you insert numbers like 1 2 3 4 5 6 and empty
the QUEUE one by one, so the numbers after each pop would be 1 2 3 4 5 6

Phase #2:

Remove the first element inserted in the READY QUEUE and put it in the
structure called CPU. Once in the CPU, the process would have 3 units
of time to execute. Each unit of time would be executed pressing the
key [ENTER] (on the keyboard). By pressing the [ENTER] key he simulator
would subtract one unit of time to the process that is in the CPU
structure.

Process ID Time required
Description


17


16


15

Phase #3:

When the process in the CPU expires, the simulator will remove the
process from the CPU and will put it at the end of other QUEUE where the
processes are sleeping. When 3 units of time have passed (3 [Enter]s ),
the simulator will remove the oldest process of this QUEUE and will put
it in the Ready QUEUE.

Phase #4:

The simulator will insert a process in the READY QUEUE every 3 cycles
([ENTER]s) up to a maximum of 25 processes. If a process runs out of
the time assigned for its execution the process will be removed from the
simulator.

Phase #5:

The program must provide information about all the processes that the
CPU had. In other words, it must show:

Pid – Process ID

States – ( Executing, Sleeping, Finished )

Description (Word, FireFox, etc. )

The time it will take to execute the process

Solution Summary

Simulator of the states of processes in an operating system in C++ is created.

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$47.88)
Included in Download
  • Plain text response
  • Attached file(s):
    • simulator.zip
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • OSPF - four router topology - OSPF lab. Using a simulator the boson simulator (or routers) I need to create a four router topology. Using any interfaces of my choice. I am given /24 networks – choosing interface addresses from t ...
  • Calculate the relative speed of a 64 bit adder using ripple carry only and configurations - Calculate the relative speed of a 64-bit adder using ripple carry only, a ripple carry of 4-bit groups that use carry lookahead, and a ripple carry of 16-bit groups that use carry lookahead. Use the s ...
  • Operating systems Function - What is one of the functions that an operating system provides to make a computer run. Explain why that is an important feature and what an OS needs to be aware of to provide that service.
  • What is the the most critical or useful function provided by an operating system? - What is the the most critical or useful function provided by an operating system? Why is memory management an important aspect of an Operating system? Each answer have to be at least 150 words.
  • C++ - 1. Why does Windows frequently crash? Microsoft hires (according to them) the best programmers in the world. Why can?t they get it right? 2. Why use functions at all? Programs can be written witho ...
Browse