Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Page Replacement Algorithm Write a program that will calculate the page faults when using LRU Your input file starts with the case number, number

  1. C++

    Page Replacement Algorithm

  2. Write a program that will calculate the page faults when using LRU
  3. Your input file starts with the case number, number of frames, and the sequence of page request
  4. Sample input file //input file Case 1, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1 Case 2, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,0 Case 3, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,2

*just a reminder for example case 1 Case 1, 3, 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1

case number = Case 1,

number of frames, = 3,

the sequence of page request = 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1

5. A sample output file will look like the following. LRU algorithm Case 1, 12 faults Case 2, 11 faults Case 3, 13 faults

I want the code to be able to read the input from a file and write the output in another file. Like using ifstream and ofstream so that my input can be varies if i want to change the value

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

Students also viewed these Databases questions