The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
For this project, download this file:
penguin.h (Provided as an attachment below)
 You work as a programmer for a startup company and your project manager has given you this legacy code (above) that was written by a programmer who left the company. The project manager needs you to expand the linked_list class to add a new function called found that will accept a value from the client and return true if the value exists in the list.  Note the return type must be bool.
Your project manager also needs you to convert the penguin class and linked_list class to templates so the class can be used by multiple client programs, each possibly using different data types.Â
Additionally, you need to write a client .cpp file for testing that creates two objects of the templated linked_list class, each with different data types.  You do not have to create a template for the clients. Â
Your program should meet the functional requirements and include a minimum of the following:
Â
class penguin {public:penguin();void addp_num(int num);int getp_num();void set_link(penguin * next_ptr) {link = next_ptr;}penguin * get_link() {return link;}private:int p_num;penguin * link;};penguin::penguin() {p_num = 0;}void penguin::addp_num(int num){p_num = num;}int penguin::getp_num(){return p_num;}class linked_list {public:linked_list() { head_ptr = NULL;}void add_penguin(int newData);void remove_headpenquin();void print_penquins();void add_sorted(int newData);void clear();private:penguin * head_ptr;};void linked_list::add_penguin(int newData){penguin * newOne = new penguin;newOne->addp_num(newData);newOne->set_link(head_ptr);head_ptr = newOne;std::cout << "head_ptr is now: " << head_ptr->getp_num() << std::endl;}void linked_list::remove_headpenquin(){if (head_ptr == NULL) std::cout << "Empty List" << std::endl;penguin * doomed = head_ptr;head_ptr = head_ptr->get_link();delete doomed;}void linked_list::clear(){penguin* doomed = head_ptr;