Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone please tell whats wrong? ivate: II One stacks of strings and the page you are currently viewing is all that is used here
Can someone please tell whats wrong?
ivate: II One stacks of strings and the page you are currently viewing is all that is used here Stack history; string currenturl; ublic: II Implement the constructor to initialize your object II with a new current page at defaulturl II At this point, your history should be empty BrowserHistory(string defaultUr1) \{ currentUrl=defaulturl; 3 II Implement the getcurrentPage method to return II the most recently visited page string getCurrentPage() \{ return currentur1; \} I/ Implement the goToPage method, which will take in a url II and update the current page II It should also push the previous page to the history II returns nothing void goToPage(string inUrl) \{ history.push(inUr1); currentUrl = inUrl 1 II Implement goBack method to go to the previous page in history II If there is no previous page to move to, ll print a message and do nothing void goBack() \{ 3 II Implement method canGoBack, II which determines whether there is a previous url in the history II Hint: your Stack class has a useful method for this! bool canGoBack() Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started