Question: Create a new C++ source file named browserhistory.cpp that implements the class declared in browserhistory.h, so that browserhistory.cpp and the provided files compile into a

 Create a new C++ source file named browserhistory.cpp that implements the

Create a new C++ source file named browserhistory.cpp that implements the class declared in browserhistory.h, so that browserhistory.cpp and the provided files compile into a program that runs with no failed tests. Final output should be "Assignment complete", please use the files below

///////////////////////////////////////////////////////////////////////////////////////////////////////////

//(browserhistory.h)

#ifndef BROWSERHISTORY_H #define BROWSERHISTORY_H #include  #include  using namespace std; class BrowserHistory { public: // Creates a new browser history with only one page visited: default_url BrowserHistory(string default_url); // Returns the current page. string current_url(); // Moves the browser to a new page url via, // e.g., clicking a link, typing into the address bar, etc. void go_to_url(string url); // Moves back (into the past) by one url. void back(); // Returns whether there is a url in the past, // i.e. whether the back button can be pushed. bool can_go_back(); // Returns how many urls are in the past, // i.e. how many times in a row the back button could be pushed. int past_url_count(); // Moves forward (into the future) by one url. void forward(); // Returns whether there is a url in future, // i.e. whether the future button can be pushed. bool can_go_forward(); // Returns how many urls are in the future, // i.e. how many times in a row the forward button could be pushed. int future_url_count(); private: class Node { public: string url; Node* next; Node* prev; }; // A head and a tail pointer Node* head; Node* tail; Node* current; }; #endif 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//(main.cpp)

 #include  #include "browserhistory.h" inline void _test(const char* expression, const char* file, int line) { cerr  0) { bh.go_to_url(line); cout   These stacks were part of the C++ 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!