Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For your lab, you will implement a template class with the following members: An array of our generic type. The size of this array should

For your lab, you will implement a template class with the following members:

An array of our generic type. The size of this array should be determined by an integer argument to the constructor.

An integer for storing the array size.

A constructor capable of accepting one integer argument. The constructor should initialize the array and set the array size.

A method, findMax, that returns the maximum value in the array.

A method, findMin, that returns the minimum value in the array.

Additionally you will need to create a short driver program that demonstrates your template class working with a few different numeric data types.

CHALLENGE

Test your program using integers, doubles, and chars. For each test, randomize the values stored in the initial array. Each type will need its own randomization method (to ensure integers for the integers array, decimal values for the doubles, and letters for the chars). Because of this, you will likely not want to include the randomization code in the template class itself.

C++

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions