Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Solutions to each of the 2 problems (2 separate programs) should be submitted vi

ID: 3600283 • Letter: S

Question

Solutions to each of the 2 problems (2 separate programs) should be submitted via D2L. All solutions are to be written in C. 1. This question consists of writing a program that translates logical to physical addresses for a virtual address space of size 65,535 bytes. Your program wil read from stdin a list of logical addresses, translate each logical address to a physical address and then print the value at that address. The goal is to simulate the steps involved in translating logical to physical addresses Design your simulation with the follow ing parameters Therefore, the page table has 2° entries. You can use a simple array to implement * Your process has been allocated n frames. n is a parameter to your program on the A page is 2-256 bytes. (Note, this means a frame is also 2"in size) this table command line · For the address translation you are to use the simple single level of page table mapping (page table is 8 bits, page offset is 8 bits) Page table Page offset I have provided a sample file memory.txt that contains the contents of the processes memory. This memory file is the second parameter to your program. When you page "in" you must load the frame with the contents of the page from this file. You can use fopen (), fread(), fseek() and fclose() to manage the file to get the data. Your program should print for each logical address read Logical address -> physical address -> char (where char is the character read at that logical address). It should also keep track of the number of page faults that occur and print the statistic at the end. Notes * Running your program with the sample file can be done as: ./a.out 10 memory.txt

Explanation / Answer

import java.io.File; importjava.io.IOException; public class RenameFile { public static void main(String[] args) { try // Here F is the object of the Existing file named with Includehelp which is to be renamed. // { File F=new File("f:/Includehelp.txt"); // Here T is the object of the renamed file of Includehelp which is Include.txt. // File T=new File ("f:/Include.txt"); // Rename the file Includehelp.txt into Include.txt. // F.renameTo(T); // Print the result if file renamed. // System.out.println("File Rename Successfully..."); } // If any error occurs while renaming the file. // catch(Exception e) { System.out.println(e); } } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote