Question
My assignment: Define a template class for a generic triplet. The private data member for the triplet is a generic array with three elements. The
My assignment:
Define a template class for a generic triplet. The private data member for the triplet is a generic array with three elements. The triplet ADT has the following functions:
default constructor
explicit constructor: initialize the data member using parameters
three accessors (three get functions) which will return the value of each individual element of the array data member
one mutator (set function) which will assign values to the data member using paramenters
find_max function which will find the maximum value of the array and return it
find_min function which will find the minimum value of the array and return it
sort_ascending function which will sort the array data member into ascending order
sort_descending function which will sort the array data member into descending order
an overloaded comparison operator == which will compare if two triplets are exactly the same
an overloaded output operator to output items in the triplet.
Write a driver to test your class. It should test each function for
o a triplet of strings
o a triplet of integers
For credit: Show your code and execute the test program.
Here is what I have so far:
Header.h
#include
Main.cpp
#include "Header.h" #include
Am I on the right path?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started