Question: In part 1 you will implement an interface provided in this handout for a simple Abstract Data Type (ADT) called a Container. The interface has

 In part 1 you will implement an interface provided in thishandout for a simple Abstract Data Type (ADT) called a Container. Theinterface has two private member variables, a stack allocated generic array andan integer size. The ADT must pass your own confidence tests submitted

In part 1 you will 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. Be advised that assignments that do not compile and run will not be graded. Refer to the lecture slides, course-textbook, and supplemental reading regarding C++ classes and template programming. 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 std::string, 10>. 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 page 4 of this handout. Much of the code is provided for convenience to assist with the first assignment. The Container interface is described below. Place the interface and implementation in a single file named Container.hpp: 1/ /l Name: Your First Name \& Last Name // SSID: Student ID Number // Assignment \#: 1 // Submission Date: 3/3/23 1/ \#ifndef__CONTAINR_HPP \#define_CONTAINER_HPP \#include class Container \{ public: using value_type =T; void add_item(T item); //output container full, if add_item cannot add T get_item(int index); //throw a string if index out of bounds void remove_item(T item); //remove first occurrence of item bool empty(); // check if Container is empty void clear(); //clear all contents, assign value_type constexpr int size(); //return current number of elements in container T* begin (); T end () ; private: int -size =0 T container [N]; 3;//Container interface

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!