Question: Implement an interface provided in this handout for a simple Abstract Data Type (ADT) called a Container. The interface has two private member variables, a

Implement an interface provided in this handout for a simple Abstract Data Type (ADT) called a Container. The interface has two private member variables, a stack allocated generic array and an integer size. The ADT must pass your own confidence tests submitted with your implementation in a file named A01.cpp. Refer to the incomplete example confidence tests provided in driver.cpp. Implement the generic Container type using C++s templating mechanism. Use the inclusion method for template programming by placing the member template definitions and the Container template declaration in a single file called Container.hpp. The Container type will have the functionality as provided in the interface shown on pages 2 & 3 of this handout. Implement only the empty,add_item,get_item,remove_item methods. A Container object is instantiated with a datatype and a value argument. For example, the declaration for a ten element container of std::string elements is Container. The value argument, 10 in the previous example, must be a constant expression. To access the instance type of a Container from a Container object, a value type alias is provided in the implementation. Refer to Microsoft source code organization and templates. for more details on structuring template code. To support modern C++s range based for looping mechanism, the begin and end methods are provided. For more details about how to implement the interface refer to the example usage and sample output on this handout. Much of the code is provided for convenience to assist with the first assignment.

Implement an interface provided in this handout for a simple Abstract DataType (ADT) called a Container. The interface has two private member variables,

1 The Container interface is described below. Place the interface and implementation in a single file named Container.hpp: // SSid: Student. ID Karher // LeEiganent H : 1 // H/ voidadd_iten(T iten); // output container full, if add_iten cannat add bool eapty ( ) // check if Contaizer ie enpty T+begin() private: int-zize =0; T contalinar [K]; b; // container intertaca Example output from tests

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!