Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

***I KNOW HOW TO READ FILE INPUT. PLEASE READ THE SPECIFICATIONS, I\"VE TRIED TO

ID: 3695905 • Letter: #

Question

***I KNOW HOW TO READ FILE INPUT. PLEASE READ THE SPECIFICATIONS, I"VE TRIED TO MAKE IT AS CLEAR AS POSSIBLE**** THANKS

Design a program which reads values from a text file in c++, store and parse these value into double data types.

This is only an simulation of an Operating System, where process can be moved from one state to the other. I have most of the classes designed but I'm stuck on how to handle file input. Each process has the following data associated in a text file document:

Arrival Time of Process, Memory needed to run, CPU time needed to complete process, No. of I/O Requests, At which time does the process request for I/O, and How long will it be in I/O.

The time at which the process enters Blocked state(after requesting for I/O) and how long it will be in I/O are dependent on the number of I/O requests.

If ia process requests for an I/O, then I will need to know when that process enters the I/O (blocked state) and how long it will be in I/O (blocked state) before moving on.

So, in total if the number of times a process requests for I/O is 4, then an array should hold values for time that process enter I/O (blocked state), 4 elements in total for this process, and another array which holds the values for how long the process will be in the I/O (blocked state), 4 elements in total for this process.

A restriction: The number of I/O requests a process can make has certain boundries. For this particular program the number of I/O requests must stay within 0 to 5 range.

The format of the file is as follows:

Arrival Time of Process, Memory needed to run, CPU time needed to complete process, No. of I/O Requests, At which time does the process request for I/O, and How long will it be in I/O.

This is an exampe of what the input file might look like:

3, 5, 50, 2, 10, 25, 5, 10
4, 10, 35, 3, 10, 20, 30, 10, 5, 6
5, 7, 25, 1, 5, 3
7, 9, 15, 4, 3, 6, 9, 1, 2, 4
10, 5, 45, 5, 5, 10, 15, 20, 30, 40, 5, 3, 4, 5, 10

To make this simpler to understand I'll use the last line of data in this example of the input file, let's call it Process 5.

10, 5, 45, 5, 5, 10, 15, 20, 30, 40, 5, 3, 4, 5, 10

So,

10 will be the arrival time of the process

5 will be the amount of memory required

45 will be the amount of time required in CPU to complete this process

5 will be the No. of I/O requests this process has made

10 15 20 30 40 will be the time of when the process will enter the I/O(blocked state)

5 3 4 5 10 will be the time spent in the I/O (blocked state)

Explanation / Answer

i have already submitted solution to above problem