Question: CODE MUST BE IN PYTHON 3 The objective of this lab is to solve problems using the Stack ADT Q1. Write a program that uses
CODE MUST BE IN PYTHON 3



The objective of this lab is to solve problems using the Stack ADT Q1. Write a program that uses the Stack implementation given to you browser has both a back and a forward button which allows the user to in Stack.py to simulate navigation in a web browser. Every web navigate to previously seen web pages. Your task is to implement this functionality using two Stack objects called forward stack and back stack. The forward stack and navigates the web. The interaction with your program will be a sequence of commands, back stack should be used to store and retrieve the urls as the user either ">", "" and "commands will be used to enter a new url web page. If the user enters the"", the computer closes. You can assume the web addresses are always valid .You will not actually have to do any web navigation. You will simply be indicate forward and back, respectively. The""command is used to would expect a url address. Finally, if the user enters "x", the program keeping track of the current page by outputting the address of the current page between "" and "]". .There are a few situations you should take care to handle. .First, if a user enters"" or">" without there being a previous or next page to go to, you should output a corresponding error message (as shown in the sample output below) but allow the user to continue browsing Secondly, if a user enters "c" and then "-" and then enters a new web address, the users previous browsing history in the ">" direction should be erased .For example, if a user is on "www.google.com", enters"", and then enters"" and then "www.yahoo.com", the history of visiting "www.google.com" should be lost. This means that if the user enters ">", this should generate an error message and not "www.google.com". This behavior can also be seen below in the sample data. You can also test an actual web browser (specifically Firefox or Chrome) if you feel there is other ambiguity. Also, keep in mind that navigation should start with a home page which we will set as "www.facebook.com" The interaction should start with the current page being www.facebook.com
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
