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

  What did you actually accomplish on the project

What did you actually accomplish on the project? What issues have arisen, and what help do you need? What do you expect to accomplish on the project?

  Design and implement an application reads in a set

Design and implement an application reads in a set of 200 grades into a two-dimensional array from a .txt file called studentanswers that represent.

  Disadvantages of vector graphics and raster graphics

Explain the basic principles, advantages, and disadvantages of vector graphics and raster graphics.

  Describenbspthe architectural differences between the

identifynbspa task you perform regularly such as cooking mowing the lawn or driving a car.writenbspa short structured

  Finalizenbspwork on the

finalizenbspwork on the microsoftregnbsppowerpointregnbspslide presentation updating it with new information based on

  Prompt the user for the details of a credit card transaction

To practice UDP programming, including the use of the socket, bind, sendto, and recvfrom system calls.

  Discuss risk and cost of compromised data integrity breaches

In 250 words or more, discuss the risk and costs of compromised data integrity breaches. Focus on integrity not confidentiality.

  Which fragments for sure are missing for the message

Which fragments for sure are missing for the message with SI = 3 and SSN = 15?

  Design a class named shirt with data fields

design an application TestShirt to instantiate three Shirt objects with different collar sizes and sleeve lengths, and then display all data , including material, for each shirt. Save as TestShirt.java

  Write the relational schema draw its dependency diagram and

a. write the relational schema draw its dependency diagram and identify all dependencies including all partial and

  What is the smallest value of n such that b runs faster

What is the smallest value of n such that B runs faster than A on inputs of size n?

  What are the relevant issues surrounding firewall deployment

What are the relevant issues surrounding firewall deployments? How does one balance security requirements with usability requirements?

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