Will simulate the step by step execution of the opt


Design and implement a virtual memory simulator based on Demand Paging.

It will be a text based application (NOT a GUI based one).

The programming language can be C or Java.

The following algorithms will be implemented: FIFO, OPT and LRU.

We will simulate the execution of each of these algorithms on a hypothetical computer having only four physical frames (numbered from 0 to 3), assuming that the single process that is running has a virtual memory of eight frames (numbered from 0 to 7).
The algorithms will be simulated based on a reference string (a sequence of pages that are to be accessed) that will be either read from the keyboard or randomly generated.

The program will be menu-based and the menu will have the following options:

0 - Exit

Will exit the program

1 - Read reference string

A reference string will be read from the keyboard and stored in a buffer. Each value of the reference string will be verified and validated (or rejected).

The user will be first asked to enter the length of the reference string, and then the string itself will be entered.

2 - Generate reference string

A reference string will be randomly generated; the length of the reference string will be given by the user interactively. The string will be stored in a buffer.

Using options 1 and 2 more than once will result in overwriting the old reference string.

3 - Display current reference string

Will display the stored reference string; if there is no reference string stored yet, an error message will be displayed.

4 - Simulate FIFO

Will simulate the step by step execution of the FIFO algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.

The user will press a key after each step of the simulation to continue the simulation.

5 - Simulate OPT

Will simulate the step by step execution of the OPT algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.

The user will press a key after each step of the simulation to continue the simulation.

6 - Simulate LRU

Will simulate the step by step execution of the LRU algorithm using the stored reference string; if there is no reference string stored yet, an error message must be displayed.

The user will press a key after each step of the simulation to continue the simulation.

Your final project will be graded based on:

• functionality
• proper style: comments, indentation, use of white space, variable names
• adherence to requirements + test plan
• user-friendly application

Test your program using the examples from the online course Module 3 and the Homework 4. Create a test plan document showing the results of this testing (testplan.doc).

Please do not forget to do a thorough error checking for this important project.

It is also important to comment your code in order to make it more easily readable and understandable.

Each file must have a block comment in the beginning.

Each class must be preceded by a comment describing the main goal and function of that class.

Each method and each attribute must be explained.

Important actions in the code must be commented (e.g: error checking).

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Will simulate the step by step execution of the opt
Reference No:- TGS0669222

Now Priced at $70 (50% Discount)

Recommended (90%)

Rated (4.3/5)