/***************************************** * Instructions * - Replace 'uwuserid' with your uWaterloo User ID * - Select the current calendar term and enter the year * - List students with whom you had discussions and who helped you * * uWaterloo User ID: uwuserid @uwaterloo.ca * Submitted for ECE 250 * Department of Electrical and Computer Engineering * University of Waterloo * Calender Term of Submission: (Winter|Spring|Fall) 201N * * By submitting this file, I affirm that * I am the author of all modifications to * the provided code. * * The following is a list of uWaterloo User IDs of those students * I had discussions with in preparing this project: * - * * The following is a list of uWaterloo User IDs of those students * who helped me with this project (describe their help; e.g., debugging): * - *****************************************/ #ifndef DROP_OFF_STACK_H #define DROP_OFF_STACK_H #ifndef nullptr #define nullptr 0 #endif #include "Exception.h" template class Drop_off_stack { private: int itop; int ibottom; int entry_count; int array_capacity; Type *array; public: Drop_off_stack( int = 10 ); Drop_off_stack( Drop_off_stack const & ); ~Drop_off_stack(); int size() const; bool empty() const; Type top() const; void swap( Drop_off_stack & ); Drop_off_stack &operator=( Drop_off_stack ); void push( Type const & ); Type pop(); void clear(); // Friends template friend std::ostream &operator<<( std::ostream &, Drop_off_stack const & ); }; template Drop_off_stack::Drop_off_stack( int n ) // : your initializations here { // Enter your implementation here. } template Drop_off_stack::Drop_off_stack( Drop_off_stack const &stack ): itop( stack.itop ), ibottom( stack.ibottom ), entry_count( stack.entry_count ), array_capacity( stack.array_capacity ), array( new Type[array_capacity] ) { // The above initializations copy the values of the appropriate // member variables and allocate memory for the data structure; // however, you must still copy the stored objects. // Enter your implementation here. } template Drop_off_stack::~Drop_off_stack() { // Enter your implementation here. } template int Drop_off_stack::size() const { // Enter your implementation here. return 0; } template bool Drop_off_stack::empty() const { // Enter your implementation here. return true; } template Type Drop_off_stack::top() const { // Enter your implementation here. return Type(); } template void Drop_off_stack::swap( Drop_off_stack &stack ) { std::swap( itop, stack.itop ); std::swap( ibottom, stack.ibottom ); std::swap( entry_count, stack.entry_count ); std::swap( array_capacity, stack.array_capacity ); std::swap( array, stack.array ); } template Drop_off_stack &Drop_off_stack::operator=( Drop_off_stack rhs ) { swap( rhs ); return *this; } template void Drop_off_stack::push( Type const &obj ) { // Enter your implementation here. } template Type Drop_off_stack::pop() { // Enter your implementation here. return Type(); } template void Drop_off_stack::clear() { // Enter your implementation here. } // You can modify this function however you want: it will not be tested template std::ostream &operator<<( std::ostream &out, Drop_off_stack const &stack ) { // I don't know how you are implementing your stack so I cannot print it. // If you want, you can print whatever you want here and then call cout // in the driver. // Remember to redirect to out, e.g., // out << "Hello!"; return out; } // Is an error showing up in ece250.h or elsewhere? // Did you forget a closing '}' ? #endif