subject
Engineering, 15.02.2020 01:52 msalecora

C++ Programming

Create a class template Pair that houses 2 items of datatype T.
Whatever datatype stored needs to implement the < and > operators.
There should be two private data attributes called item1 and item2.
There should be the following public methods.

A 2 argument constructor.
A method getMax that returns the larger of the two stored items.
A method getMin that returns the smaller of the two stored items.
A method setItems that takes in two constant items by reference and sets item1 and item2 to them.
A method getItem1 that returns item1.
A method getItem2 that returns item2.

Make a appropriate methods const so they don't alter item1 or item2 if not needed.

You should have a Pair. h and Pair. cpp file.

Create a pairTest. cpp file with a main() that creates two pairs, one that houses ints an one that houses strings.
Test all the methods for these two Pairs in your main and display the results.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 16:10
An electrical motor raises a 50kg load at a construct velencity .calculate the power of the motor, if it takes 40sec to raise the load through a height of 24m(take g =9.8n/g)
Answers: 2
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:10
Which one from below is not one of the reasons of planning failures? (clo3) a)-planner is careless. b-planner spend less time in the field but more time on the desk c)-planner is not qualified d)-planner does not have sufficient time to properly plan
Answers: 3
question
Engineering, 04.07.2019 18:20
Aquick transition of the operating speed of a shaft from its critical speed will whirl amplitude. (a) increase (b) limit (c) not affect (d) zero
Answers: 2
You know the right answer?
C++ Programming

Create a class template Pair that houses 2 items of datatype T.
Wh...
Questions
question
Mathematics, 18.03.2020 00:42
question
Mathematics, 18.03.2020 00:42
question
Mathematics, 18.03.2020 00:43