In C++ programming Language using Visual Studio(Not Visual Studio Code) Suppose you have a vector of integer data, say { 1, 5, 4, 2, 3 } The data may eventually need to be transformed into some other form, say by sorting the data values for instance This would turn the vector into { 1, 2, 3, 4, 5 } Or say I wanted to take the original vector { 1, 5, 4, 2, 3 } and remove all the even numbers from it This would turn the vector into { 1, 5, 3 } So in general terms, we start with an input vector, and it somehow gets transformed into its transformed vector The options really are almost limitless, but we will keep things simple for this checkpoint assignment We will be developing a base/derived class relationship that can perform custom transformations of data at runtime Your submission must follow OOP best practices that incorporates topics in Gaddis' textbook chapters 13 through 15 { 1, 5, 4, 2, 3 }  ==========(SORT)==========> { 1, 2, 3, 4, 5 } { 1, 5, 4, 2, 3 }  ======(REMOVE EVENS)======> { 1, 5, 3 } { 1, 5, 4, 2, 3 }  ========(CONSTANT)========> { 1, 5, 4, 2, 3 } Start with this collection of files and incorporate them into a project using whichever IDE you are comfortable with The main.cpp file will do all the heavy lifting of creating the objects mentioned here and testing their expected behaviors The Transformation.h file will hold your code for part one The Constant.h file will hold your code for part two The Sort.h file will hold your code for part three You will need to add code in one section of the main.cpp file as described below to complete part four PART 1) The base class for this relationship will be called Transformation and has the following properties that need developing: Every Transformaton object maintains a vector of integer values which can only be directly accessed by itself and its derived classes The only constructor for this base class takes a vector of integer values as its only parameter, and copies all its values in order into the maintained vector A function called Print() will print every element of the maintained vector, space separated, with a newline character when exhausted A function called GetVectorCopy() will simply return a copy of the maintained vector A function called Transform() will do something different to the maintained vector for each derived class, but by itself has no true default behavior PART 2) One derived class of Transformation to develop will be called Constant The only constructor for this derived class takes a vector of integer values as its only parameter and passes it along to its base class A function called Transform() will do nothing at all to the maintained vector, thus the name of the class type PART 3) A second derived class of Transformation to develop will be called Sort The only constructor for this derived class takes a vector of integer values as its only parameter and passes it along to its base class A function called Transform() will sort the maintained vector, thus the name of the class type PART 4) You will need to add code to the PrintHeaderForElement() function inside of the main.cpp file For a given element, if it is a pointer to a Constant object print "CONSTANT: " For a given element, if it is a pointer to a Sort object print "SORT:     " Which C++ keyword can be used at runtime to determine an object's type? Now the program should run without issue, and your output should match what is seen below If there are errors in your code and/or architecture, then the test cases will halt and tell you one part of the requirements that are lacking Zip up your four C++ source code files and submit your solution here to Blackboard within your time window You may email me your submission if you are having technical difficulties, but the email must still come in within your time window  Expected output of this completed program --------BEFORE-------- CONSTANT: 1 6 3 4 2 SORT:     11 65 35 14 3 99 CONSTANT: 2 6 5 14 2 99 103232 SORT:     11 8 5 2 94 15 3 CONSTANT: 1 7 13 14 12 11 11 8 ---------AFTER-------- CONSTANT: 1 6 3 4 2 SORT:     3 11 14 35 65 99 CONSTANT: 2 6 5 14 2 99 103232 SORT:     2 3 5 8 11 15 94 CONSTANT: 1 7 13 14 12 11 11 8 ----------------------

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question

In C++ programming Language using Visual Studio(Not Visual Studio Code)

Suppose you have a vector of integer data, say { 1, 5, 4, 2, 3 }
The data may eventually need to be transformed into some other form, say by sorting the data values for instance
This would turn the vector into { 1, 2, 3, 4, 5 }
Or say I wanted to take the original vector { 1, 5, 4, 2, 3 } and remove all the even numbers from it
This would turn the vector into { 1, 5, 3 }
So in general terms, we start with an input vector, and it somehow gets transformed into its transformed vector
The options really are almost limitless, but we will keep things simple for this checkpoint assignment
We will be developing a base/derived class relationship that can perform custom transformations of data at runtime
Your submission must follow OOP best practices that incorporates topics in Gaddis' textbook chapters 13 through 15

{ 1, 5, 4, 2, 3 }  ==========(SORT)==========> { 1, 2, 3, 4, 5 }
{ 1, 5, 4, 2, 3 }  ======(REMOVE EVENS)======> { 1, 5, 3 }
{ 1, 5, 4, 2, 3 }  ========(CONSTANT)========> { 1, 5, 4, 2, 3 }

Start with this collection of files and incorporate them into a project using whichever IDE you are comfortable with
The main.cpp file will do all the heavy lifting of creating the objects mentioned here and testing their expected behaviors
The Transformation.h file will hold your code for part one
The Constant.h file will hold your code for part two
The Sort.h file will hold your code for part three
You will need to add code in one section of the main.cpp file as described below to complete part four

PART 1) The base class for this relationship will be called Transformation and has the following properties that need developing:

  • Every Transformaton object maintains a vector of integer values which can only be directly accessed by itself and its derived classes
  • The only constructor for this base class takes a vector of integer values as its only parameter, and copies all its values in order into the maintained vector
  • A function called Print() will print every element of the maintained vector, space separated, with a newline character when exhausted
  • A function called GetVectorCopy() will simply return a copy of the maintained vector
  • A function called Transform() will do something different to the maintained vector for each derived class, but by itself has no true default behavior

PART 2) One derived class of Transformation to develop will be called Constant

  • The only constructor for this derived class takes a vector of integer values as its only parameter and passes it along to its base class
  • A function called Transform() will do nothing at all to the maintained vector, thus the name of the class type

PART 3) A second derived class of Transformation to develop will be called Sort

  • The only constructor for this derived class takes a vector of integer values as its only parameter and passes it along to its base class
  • A function called Transform() will sort the maintained vector, thus the name of the class type

PART 4) You will need to add code to the PrintHeaderForElement() function inside of the main.cpp file

  • For a given element, if it is a pointer to a Constant object print "CONSTANT: "
  • For a given element, if it is a pointer to a Sort object print "SORT:     "
  • Which C++ keyword can be used at runtime to determine an object's type?

Now the program should run without issue, and your output should match what is seen below
If there are errors in your code and/or architecture, then the test cases will halt and tell you one part of the requirements that are lacking

Zip up your four C++ source code files and submit your solution here to Blackboard within your time window
You may email me your submission if you are having technical difficulties, but the email must still come in within your time window 

Expected output of this completed program
--------BEFORE--------
CONSTANT: 1 6 3 4 2
SORT:     11 65 35 14 3 99
CONSTANT: 2 6 5 14 2 99 103232
SORT:     11 8 5 2 94 15 3
CONSTANT: 1 7 13 14 12 11 11 8
---------AFTER--------
CONSTANT: 1 6 3 4 2
SORT:     3 11 14 35 65 99
CONSTANT: 2 6 5 14 2 99 103232
SORT:     2 3 5 8 11 15 94
CONSTANT: 1 7 13 14 12 11 11 8
----------------------

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning