Write a c program compute the number of page faults

Assignment Help Computer Engineering
Reference no: EM132196979

Write a C program (well-structured modular) to compute the number of page faults for the FIFO page replacement scheme, given a reference string.

The program can be structured as follows: the program will first interactively prompt and read the length of the reference string and then reference string itself.

Then it will prompt and read the range for the number of page frames. For each value in the range then simulate the execution of the page replacement algorithm on the reference string, compute the number of page faults and print it out.

Assume that the length of the reference string is at most 20 so that the reference string can be stored in an array of int type.

Assume that the number of frames available will be at most 20, so you can implement the data structure (queue) needed for the simulation of the algorithm using arrays rather than using pointers, if you prefer it that way. Also assume that all frames are initially empty, so your first unique pages will all cost one fault each.

Here is a sample run of the program:

Welcome to FIFO Page Replacement Simulation Program!!

Enter the length of the reference string: 12

Enter the reference string: 1 2 3 4 1 2 5 1 2 3 4 5

Enter the range for number of frames: 1 6

Page fault for 1 frame(s): 12

Page fault for 2 frame(s): 12

Page fault for 3 frame(s): 9

Page fault for 4 frame(s): 10

Page fault for 5 frame(s): 5

Page fault for 6 frame(s): 5

Program terminated

Reference no: EM132196979

Questions Cloud

Explain advantages and disadvantages of globalization : Globalization brings with it both advantages and disadvantages, economic and otherwise. List some of each, according to your own view of globalization.
Create a dunbar object set the force of the object : Write the class that will carry out the following steps. This code would be part of a program, but you only have to write out the steps requested here.
Make the three data members private : Write a class to contain the following information about towns: the name (a sequence of characters); the population (an integer);
Draw a graph of typical indifference curves : Draw a graph of typical indifference curves, budget constraints, the optimal choice of a typical subscriber under the current fixed-rate policy.
Write a c program compute the number of page faults : Write a C program compute the number of page faults for the FIFO page replacement scheme, given a reference string.
Explain graphically the speculative attacks : Explain graphically the speculative attacks that occurred against the British pound in 1992, the Mexican peso in 1994, the Thai baht in 1997.
Fill all array elements with a zero except those diagonal : Declare a two dimensional array with 10 rows and 10 columns of whole numbers.
Does income effect incentivize person to take less leisure : Change the wage to $8. From a starting point of 500 hours of work at $10 an hour, does the income effect incentivize the person to take less leisure.
Draw a dashed curve showing the equilibirum price trajectory : Draw a dashed curve showing the equilibirum price trajectory(price as a function of time); list the conditions used to obtain this graph.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain the factors that went into your decision

Explain the factors that went into your decision, the design alternatives you considered, your evaluation of design decisions, and the reasoning for your final

  Questionin a given heath information management department

questionin a given heath information management department or facility use worksheet to do following-1.classify all the

  Comment on your observations in a statement

Analytically convert this ordinary differential equation into an equivalent system of coupled first order ordinary differential equations.

  Identify how you plan to stay on track

You have been selected to be the project manager (for a project of your choice). The project that you decide to use should meet all the key criteria.

  Write a program that plays a simple trivia game

Write a program that plays a simple trivia game. The game should have five questions. Each question has a corresponding answer and point value between 1 and 3 based on the difficult of the question.

  Describe the volatile live acquisition process

Describe the volatile live acquisition process to collect evidence related to system memory and registry changes and analysis methods conducted.

  List two reasons why a company would pursue onshoring

List two reasons why a company would pursue onshoring or insourcing. List two reasons why a company would not pursue onshoring or insourcing.

  Calculate how many weeks it would take for the weight

Using a while loop, calculate how many weeks it would take for the weight of the first rat to become 25 percent heavier than it was originally.

  How many comparisons of keys will be done by count sort

Determine how many comparisons of keys will be done by count sort. Is it a better algorithm than selection sort?

  Implement a function for setting width of displayed ellipses

implement a function for controlling line type tsolid, dashed, dotted of displayed ellipses. Implement a function for setting the width of displayed ellipses.

  Professional ethics play a vital role in the computing

professional ethics play a vital role in the computing profession. the conduct of it professionals influences many

  How to use array list and int field to implement an iterator

Describe how to use an array list and an int field to implement an iterator. Include pseudo-code fragments describing hasNext() and next().

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd