Question: I need to run this C++ code on Netbean IDE. We can think that the virtual memory is the hard disk and the main memory

I need to run this C++ code on Netbean IDE.

We can think that the virtual memory is the hard disk and the main memory is the RAM in PC. Assume that the virtual memory has 5 to 9 pages and the main memory has 3 to 5 frames. The frame size is the same as page size. The size can be any reasonable kilobytes, say, 16 Kbytes or 64 Kbytes.

a. In this program, you will:

Prompt the user to enter the number of pages (5 to 9)

Prompt the user to enter the number of frames (3 to 5)

Prompt the user to enter the page reference string. Spaces are used to separate the page numbers referenced by the processes.

Implement the FIFO page replacement algorithm. Your program should cover a few situations:

o Pure page demanding (at least one frame is left in the main memory, occurs initially)

o The page requested is already in one of the frames in the main memory (requested before and not replaced yet)

o The page is not in the main memory and the oldest page among all frames needed to be replaced with the new one

Display all frame replacements sequence

Calculate and display the number of page faults

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!