Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 162 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5. Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 16 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5. Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 162 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5. Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 16 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5. Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 162 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5. Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 16 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5. Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 162 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5. Write a Java or C/C++ (the choice is yours) program for a Demand Paging Simulator according to the following rules. The program will implement two Demand Paging algorithms: the classical OPT algorithm (described in the module 5 readings) and a NEW algorithm, described below. The application must simulate the execution the OPT and NEW algorithms on a hypothetical computer having only N physical frames (numbered from 0 to N-1; the maximum value for the parameter N is 8), assuming that the single process that is running has a virtual memory of ten pages (numbered from 0 to 9). The number N should be a number provided as an input for the algorithms, using the program menu. To clarify, the user should be able to run the OPT algorithm (for example) using the same reference string for a scenario where N is 4, then change N to 5 and run again, then change N to 6 and run again and in the end compare the results for each scenario. In other words, the number of physical frames should not be fixed (hardcoded) in the program, but rather considered as an input variable (parameter) for the implemented algorithms. The program requested for this project must have a text menu like this: 0 Exit 1- Input N 2 3 4 Select option: Input the reference string Simulate the OPT algorithm Simulate the NEW algorithm The menu is displayed and the user must select an option (a number between 0 and 4). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program execution. The options are: 0-Exit This options ends the program execution. This option should always work. 1-Input N The user is prompted for a [positive integer] number N. This is normally one of the first options that must be selected by the user. The number N must be at least 2 (otherwise the algorithms don't make any sense) but should not be larger than 8; the program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another N and work with the new N just as easily as before. 2-Input the reference string The user is prompted for a series of [positive integer) numbers that will constitute the reference string. The maximum length of the reference string should be 20. This is normally one of the first options that must be selected by the user. The number of elements in the reference string must be at least N (otherwise the algorithms don't make any sense) but should not be larger than 20; each element of the reference string must be an integer number between 0 and 9 (there are 10 virtual pages). The program must verify these constraints and issue an error message whenever necessary. After performing several operations from the menu, the user should be able to select another reference string and work with the new reference string just as easily as before. 3-Simulate the OPT algorithm This option must first verify that a correct N and a correct reference string were already provided by the user; otherwise an error message should be issued and the program returns to the menu. If all the input data (N and the reference string) is available and correct, the simulation begins by printing the initial (empty) simulation table, for example: Reference Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Page Faults Victim pages 3 16 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Hint 1: Instead of the above reference string, the table will contain the ACTUAL reference string that was entered by the user; of course, everyone can use their reference strings for testing the correctness of the implementation. Using the reference strings from the readings to test your code is a great idea. Hint 2: Instead of having 4 physical frames in the simulation table, must actually have N physical frames. So if the user has entered the value 6 for N using option 1 of the menu, then the simulation table should look like this: Reference String 3 1 6 2 1 3 7 3 2 1 5 4 2 3 7 2 1 Physical frame 0 Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 Physical frame 5 Page Faults Victim pages Hint 3: Being a text only interface, clearly we cannot display such a nice table, but rather an approximation of it; the table could instead look like this or similar: Reference string Physical frame e Physical frame 1 Physical frame 2 Physical frame 3 Physical frame 4 | 8|2|7 Page faults victim Pages | 5 11 The user must proceed with the STEP by STEP simulation of the OPT algorithm by pressing a key after each step of the algorithm; just as in the examples from the module 5 readings, each step of the simulation will fill a new column of the simulation table (previous steps must also be visible) and the table is re-printed on the screen after each step. This way, the user has an overview of all the previous steps and also of the current step. In the end, the table will be completely filled with information, and the user will have the complete view of the simulation. The total number of faults must also be displayed. In other words, the simulation must follow very closely the examples of Demand Paging algorithms from Module 5 of this course. Printing the explanations is optional. 4- Simulate the NEW algorithm The simulation proceeds just like it did in option 4, but this time the algorithm is no longer the well known OPT algorithm, but a NEW algorithm. This NEW algorithm is a modified version of the LRU algorithm (LRU algorithm was discussed in Module 5 of this course). So how exactly does the NEW algorithm work? The NEW algorithm works just like the LRU algorithm with just one small change, regarding the policy for page replacement, when such an event occurs, and a page must be evicted and replaced with another page. In case of the LRU algorithm, the victim page is the one that has not been accessed, or used, for the longest period of time. Instead, in the NEW algorithm, the victim page is going to be the one that has not been accessed, or used, for the SECOND longest period of time. Consider the following example from the Module 5 LRU example, step 17: - Page 4: was referenced 5 steps ago Page 3: was referenced 3 steps ago - Page 7: was referenced 2 steps ago - Page 2: was referenced 1 step ago The victim page for LRU is therefore page 4, because it was not accessed for the longest time. However, the victim page for NEW is page 3, because it was not accessed for the SECOND longest time. Testing procedure for one set of input parameters (N, reference string): 0. Option 0 requires just one screenshot, for successful exit. 1. Option 1 requires one screenshot for a correct input of N and one screenshot for an incorrect N. 2. Option 2 requires one screenshot for a correct input of a reference string and several screenshots for an incorrect reference string, as several errors are possible (incorrect element smaller than 0, incorrect element greater than 9, incorrect sequence length). 3. Option 3 requires screenshots showing the simulation of the OPT algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). 4. Option 4 requires screenshots showing the simulation of the NEW algorithm. Two screenshots will suffice: one showing the "middle" of the simulation (approximately) and another showing the end of the simulation (simulation table must be full with information). Deliverables: 1. Source code (zipped) 2. A Test Report (called Test1.docx/Test1.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=4 and the reference string from Homework 5. 3. A Test Report (called Test2.docx/Test2.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=5 and the reference string from Homework 5. 2. A Test Report (called Test3.docx/Test3.pdf) showing the program performing each of the menu actions correctly (use the testing procedure described above, include all the required screenshots) for N=6 and the reference string from Homework 5.
Expert Answer:
Answer rating: 100% (QA)
Heres a Java program that implements a Demand Paging Simulator with the OPT and NEW algorithms according to the given rules import javautil public class DemandPagingSimulator private static int N Numb... View the full answer
Related Book For
Smith and Roberson Business Law
ISBN: 978-0538473637
15th Edition
Authors: Richard A. Mann, Barry S. Roberts
Posted Date:
Students also viewed these programming questions
-
AI Rewrite this AI: The AICPA report highlights a decline in accounting graduates for the 2021-22 academic year, with decreases in both bachelor's and master's degree earners. However, enrollment...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Evaluate the limit or state that it does not exist. lim (x,y) (1,-3) In(3x + y)
-
A crate of mass 80 kg is held in the position shown. Determine (a) The moment produced by the weight W of the crate about E, (b) The smallest force applied smallest force applied smallest force...
-
A pipe with a series of holes as shown in the figure is used in many engineering systems to distribute gas into a system. The volume flow rate through each hole depends on the pressure difference...
-
Blockbuster, Inc., is the world's leading provider of rentable DVDs and videogames. Blockbuster estimates that 64 percent of the U.S. population lives within a 10-minute drive of a Blockbuster store....
-
Transactions made by Morlan and Co., a law firm, for the month of March are shown on the next page. Prepare a tabular analysis which shows the effects of these transactions on the accounting...
-
The Field, Brown & Snow are partners and share income and losses equality. The partner decide to liquidate the partnership when their capital balances are as follows: Field, $131,100; Brown,...
-
The following information is taken from the accounts of FasGrow Company. The entries in the T-accounts are summaries of the transactions that affected those accounts during the year. The overhead...
-
Morton Watch Company reported the following income statement data for a 2-year period. 2015 2016 sales revenue $260,000 $320,000 cost of goods sold Initial inventory 32,000 44.000 Cost of goods...
-
John has had a very good year and has over $600,000 of taxable income, including a sizable amount of capital gains. He's thinking of selling a large block of stock to a neighbor at a price...
-
According to Alcntara Armando, it is a very important element to understand the direction that university systems are following, particularly in developing countries. Select one: The economic and...
-
At the end of its accounting period, December 31, of Year 1, Hsu's Financial Services has assets of $575,000 and stockholders' equity of $335,000. Using the accounting equation and considering each...
-
The materiality calculation for Apollo Shoes seems appropriate, utilizing adjusted net income as the basis, adhering to a 5% threshold. This aligns with standard practices for profit-oriented...
-
Why should I pay 3 dollars per tutor if I have paid the hero subscription?
-
Discuss the mutual fund theorem.
-
The value of a share of common stock depends on the cash flows it is expected to provide, and those flows consist of the dividends the investor receives each year while holding the stock and the...
-
By contract dated January 5, Rebecca agreed to sell to Nancy, and Nancy agreed to buy from Rebecca, a certain parcel of land then zoned commercial. The specific intent of Nancy, which was known to...
-
Vette sued Aetna under a fire insurance policy. Aetna moved for summary judgment on the basis that the pleadings and discovered evidence showed a lack of an insurable interest in Vette. (An insurable...
-
B, a chemist, was employed by A, a manufacturer, to work on a secret process for As product under an exclusive three-year contract. A employed C, a salesperson, on a week-to-week basis. B and C...
-
Apple stock is selling for \($120\) per share. Call options with a \($117\) exercise price are priced at \($12.\) What is the intrinsic value of the option, and what is the time value?
-
Refer to Problem 14.9. What would the loss of the seller of the put option be if, at expiration, XLB is trading at \($20?\) What would the profit of the seller be if, at expiration, XLB is trading at...
-
Ibrahim bought 200 shares of a stock trading in the Abu Dhabi Securities Exchange at AED 12 (United Arab Emirates dirham) per share. Over time, the price of the stock increased to AED 18 per share....
Study smarter with the SolutionInn App