Question: 1 . Comparable class Define class Comparable in file Compareble.h . Since the methods are very small, make them all inlined. 1 . 1 .

1. Comparable class
Define class Comparable in file Compareble.h. Since the methods are very small, make
them all inlined.
1.1.(2 points) Has two private data components of the same type, named item1 and item2.
1.2.(2 points) Has a public function bool firstIsLessThanSecond() that checks if
item1 is less than item2.
1.3.(2 points) Has a public function bool firstIsGreaterThanSecond() that checks if
item1 is greater than item2.
1.4.(2 points) Has public function bool firstIsEqualToSecond() that checks if item1 is
equal to item2.
1.5.(2 points) Has a constructor Comparable(...) that receives two inputs of the same
type as the private data components and assigns the first input to item1, and the
second input to item2.
2. main function
In main.cpp do the following step by step:
2.1.(1 point) Define integer array a[], and initialize it with numbers 6,10,-4,11, and -
2.
2.2.(1 point) Define character array str[] of length 7, and initialize it with Hello..
2.3.(2 points) Declare vec1 to be a vector of integers, and vec2 to be a vector of characters.
2.4.(2 points) Define function void reverseArray(...) that receives an array of any
arbitrary type, along with its size (an integer). It reverses the order of array elements.

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!