File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ def menu():
1515 print ('+-------------------------------------+' )
1616 print ('|--- *Page Replacement Simulation* ---|' )
1717 print ('+-------------------------------------+\n ' )
18- print ("[1] FIFO" )
19- print ("[2] LRU" )
20- print ("[3] LFU" )
21- print ("[4] Optimal" )
18+ print ("[1] FIFO - First In First Out " )
19+ print ("[2] LRU - Least Recently Used " )
20+ print ("[3] LFU - Least Frequently Used " )
21+ print ("[4] Optimal\n " )
2222 print ("[0] Exit" )
2323 print ()
2424
@@ -48,6 +48,7 @@ def main():
4848 }
4949
5050 while True :
51+ clear ()
5152 menu ()
5253 choice = input ("Enter choice: " )
5354 print ()
@@ -59,12 +60,18 @@ def main():
5960
6061 algorithm = algorithms .get (choice )
6162 if algorithm :
62- clear ()
63- execute_algorithm (algorithm )
63+ try :
64+ clear ()
65+ execute_algorithm (algorithm )
66+ input ("\n Press Enter to return to the menu..." )
67+ except Exception as e :
68+ clear ()
69+ print (f"An error occurred: { str (e )} " )
70+ input ("\n Press Enter to continue..." )
6471 else :
6572 clear ()
66- print ("Invalid input. Please try again ." )
67- print ( )
73+ print ("Invalid input. Please choose a valid option ." )
74+ input ( " \n Press Enter to continue..." )
6875
6976
7077if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments