Question
// USE HEADER #pragma once // LStack.h #ifndef STACK_H_ #define STACK_H_ #include #include using namespace std; template struct Node { T data; Node * next;
// USE HEADER
#pragma once // LStack.h
#ifndef STACK_H_ #define STACK_H_
#include
template
template
//resets the stack to its initial state template
//insert a new item to the top of stack template
//retrieve (remove and return) the top value template
template
#endif /* STACK_H_ */
Question: In this homework you are expected to develop a simple version of the web browsers' "Go back one page, and Go forward one page functionality utilizing two stacks. These two stacks will be called as backward_stack and forward_stack. They will keep the web addresses that you visited previously. In the application you will generate a menu as displayed in the sample run and allow user to select following functionalities; visit new webpage", "go back one page", "go forward one page. Do not forget that the webpage you currently are in may not have a previous page or a forward page. If that is the case, you must give appropriate error messages. Check the sample output thoroughly to understand the application functionality. Important Note: Use lStack.h header file on the moodle web page, which is also attached to this homework notification Do not change any functionality within the header file or upload your own header file. Your home-works will be graded only with the given header file. Sample Run: Choose (N) ew page, go (B) ack one page, go (F)orward one page (Q) uit: N Enter new page address: www.google.com You are currently visiting google. Choose (N) ew page, go (B)ack one page, go (F)orward one page (Q) uit: F Error! There is no Forward page. You are currently visiting google. Choose (N) ew page, go (B)ack one page, go (F)orward one page (Q) uit: N Enter new page address: www.instagram.com You are currently visiting instagram. Choose (N) ew page, go (B)ack one page, go (F)orward one page (Q) uit: B You have gone back one page. You are currently visiting google. Choose (N) ew page, go (B)ack one page, go (F) orward one page (Q) uit: B Error! There is no page before. You are currently visiting google. Choose (N) ew page, go (B)ack one page, go (F) orward one page (0) uit: N Enter new page address: www.coursera.org You are currently visiting coursera. Forward Stack cleared. Choose (N) ew page, go (B)ack one page, go (F)orward one page (0) uit: F Error! There is no Forward page. You are currently visiting coursera. Choose (N) ew page, go (B)ack one page, go (F)orward one page (0) uit: B You have gone back one page. You are currently visiting google. Choose (N) ew page, go (B)ack one page, go (F) orward one page (0) uit: F You have gone to the Forward page. You are currently visiting coursera. Choose (N) ew page, go (B)ack one page, go (F) orward one page (Q) uit: 0 Thank you for using this simple browser. Have a nice dayStep 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