1) 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.
1) 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.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 15PE
Related questions
Question
I need the answer as soon as possible
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
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
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning