Question: Program 2 . Simulate batch processing with Multiprogramming.Requirements: 1 . The program will ask for the initial number of jobs, and then create batches with

Program 2. Simulate batch processing with Multiprogramming.Requirements:
1. The program will ask for the initial number of jobs, and then create batches with a maximum capacity of 4(see Program Requirements 1).
2. In this simulation the information for each job will be generated internally, that is, it will no longer be necessary to enter data from the keyboard, the information to be generated is: a. Number of each process, validate that it is unique. (Can be consecutive) b. Estimated Maximum Time will be generated randomly, validating that it is greater than 0(range between 5 and 18).
c. Operation (+,-,*,/, remainder) to be performed with its operands (validate operations), randomly.
NOTE: In the previous practice, the programmer's name was captured; in this practice, that information is no longer required (it is eliminated).
3. Jobs will be executed according to their assigned number (ID).
4. Processes once running can be Interrupted by Entry/Exit or terminated by Error (Note the difference in the table).
5. Interruption and termination of running jobs will be generated by keys. 6. The keys to use are:
Key
Which indicates?
What are you doing?
AND
Interrupt by input output
The process that is in use of the processor (execution) must exit it and go to the queue of the processes of the batch in execution (current).
IN
Error
The process that is running at that moment will terminate by error, that is, it will exit the processor and will be displayed as finished. In this case, since the process did not terminate, an error will normally be displayed instead of a result.
P
Break
Stops the execution of your program momentarily, the simulation resumes when the C key is pressed.
C
Continue
Pressing this key will resume the program previously paused with P.
7. It should be displayed on the screen:
to. Waiting Processes corresponding to the Batch in execution:
Yo. Program Number.
ii. Estimated Maximum Time.
iii. Show elapsed time. If the process has not yet been executed, 0 will be displayed.
b. Number of Pending Batches: Specify the number of pending batches to be executed, if there are none, 0 will be displayed.
c. Running Process:
Yo. All data corresponding to the process will be displayed.
ii. Time that has already been executed.
iii. Remaining time to execute
d. Completed Jobs::
Program Number.
ii. Operation
iii. Result of the operation or ERROR when the process has been terminated with the key that generates the error.
and. Clock (General Accountant).
8. Upon completion of the running batch, it will continue with the next waiting batch. 9. The program will end when all operations for all batches have been performed (Pause).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!