Question: do in c++ please Computer Science II CSCI 136 - Lesson 4 Class Template and Function Overloading Purpose: The goal of this lab is to

 do in c++ please Computer Science II CSCI 136 - Lesson

do in c++ please

Computer Science II CSCI 136 - Lesson 4 Class Template and Function Overloading Purpose: The goal of this lab is to experience how to pass any data type into a class/function template by using a type of parameter (template). As discussed in class, a class template is a simple and yet very powerful tool in C++ that helps to use same operations and containers for different object types. You will explore the idea of passing data type as a parameter so that we do not need to write the same code for different data types. Tasks: This lab must be completed and submitted on or before the due date Sunday 11:59pm. Submission link is provided on Blackboard. Lab-Homework - Write a class program that can store data items of any data type (int, float, char, string, and double) in an array container within a class. That is one class, one private member array container (any other data member data) and member functions based on the data type. Your program must be able to pass the type of the elements into the array container using a function in the class from the main(), and print content. All operations (e.g., function to add elements and display/print) must be member functions in the class. You will create an object for each of the data types (e.g., intObject, floatObject, etc.); store/add at least 5 elements of each data types in the container using a member function and list the content (use the display/print function to list content). Rubric: Grading for this lab will be based on your ability to declare and define the class. Implement the container to store the different types of data. Have fun

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!