C++ program that use the OOD to define and implements the class Robot1 DType. The Class Robot1DType simulate a one dimensional robot that can move in two direction over one axis and it has the following variable members Cpos (Current position), Dist (Distance) and Dir (Direction) (of the last robot movements). Moreover, the class has the Constructor with default parameters, the Move(Dx), getPos(), getDist(), getDir(), setRobot(cX, cDis, cDir), and Print() nethods(functions). The Move(Dx) method is affected on the CPos, Dist and Dir Variables. Ex: Robot1DType Robot(0,0,0) Cpos-0, Dist=0, and Dir=0. Robot.Move(10) Cpos-10, Dist=10, and Dir= +1. Robot.Move(-5) Cpos-5, Dist-5, and Dir= -1. 22) Use the Inheritance concept to derive a new class called LightRobot class from the base class Robot1DType. The Derived class LightRobot class has an additional member variable called PCLights (Color Lights) which is an integer ointer refer to an array of 3 integer elements (to store the Red, Green and Blue Lights values). It has its constructors with default parameters values, copy constructor, and destructor. Moreover it has getRobotLight (Lights[], NoOfLights), sctRobotLight(Lights[1.NoOfLights), and Print() methods (functions).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
I need the answer as soon as possible
Write a C++ program that use the OOD to define and implements the class Robot1DType. The Class Robot1DType
simulate a one dimensional robot that can move in two direction over one axis and it has the following variable members
Cpos (Current position), Dist (Distance) and Dir (Direction) (of the last robot movements). Moreover, the class has the
constructor with default parameters, the Move(Dx), getPos(), getDist(), getDir(), setRobot(cX, cDis, cDir), and Print()
methods(functions). The Move(Dx) method is affected on the CPos, Dist and Dir Variables. Ex: Robot1DType
Robot(0,0,0)→ Cpos=0, Dist=0, and Dir=0. Robot. Move(10) Cpos=10, Dist=10, and Dir= +1.
Robot.Move(-5) Cpos-5, Dist=5, and Dir= -1.
Q2) Use the Inheritance concept to derive a new class called LightRobot class from the base class Robot1DType. The
Derived class LightRobot class has an additional member variable called pCLights (Color Lights) which is an integer
pointer refer to an array of 3 integer elements (to store the Red, Green and Blue Lights values). It has its constructors
with default parameters values, copy constructor, and destructor. Moreover it has getRobotLight (Lights[],
NoOfLights), setRobotLight(Lights[],NoOfLights), and Print() methods (functions).
Transcribed Image Text:Write a C++ program that use the OOD to define and implements the class Robot1DType. The Class Robot1DType simulate a one dimensional robot that can move in two direction over one axis and it has the following variable members Cpos (Current position), Dist (Distance) and Dir (Direction) (of the last robot movements). Moreover, the class has the constructor with default parameters, the Move(Dx), getPos(), getDist(), getDir(), setRobot(cX, cDis, cDir), and Print() methods(functions). The Move(Dx) method is affected on the CPos, Dist and Dir Variables. Ex: Robot1DType Robot(0,0,0)→ Cpos=0, Dist=0, and Dir=0. Robot. Move(10) Cpos=10, Dist=10, and Dir= +1. Robot.Move(-5) Cpos-5, Dist=5, and Dir= -1. Q2) Use the Inheritance concept to derive a new class called LightRobot class from the base class Robot1DType. The Derived class LightRobot class has an additional member variable called pCLights (Color Lights) which is an integer pointer refer to an array of 3 integer elements (to store the Red, Green and Blue Lights values). It has its constructors with default parameters values, copy constructor, and destructor. Moreover it has getRobotLight (Lights[], NoOfLights), setRobotLight(Lights[],NoOfLights), and Print() methods (functions).
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Reference Types in Function
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education