Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions