Question: Using the following stack class, create a program that will ask the user to input a word letter-by-letter and then displays the word backwards. #ifndef

Using the following stack class, create a program that will ask the user to input a word letter-by-letter and then displays the word backwards.

#ifndef MAIN_SAVITCH_STACK2_H #define MAIN_SAVITCH_STACK2_H #include #include "node2.h"

namespace main_savitch_7B { template class stack { public: typedef size_t size_type; typedef Item value_type; stack( ) { top_ptr = NULL; } stack(const stack& source); ~stack( ) { main_savitch_6B::list_clear(top_ptr); } void push(const Item& entry); void pop( ); void operator =(const stack& source); size_type size( ) const { return main_savitch_6B::list_length(top_ptr); } bool empty( ) const { return (top_ptr == NULL); } Item top( ) const; private: main_savitch_6B::node *top_ptr; }; }

#include "stack2.template" #endif

(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!