Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Description The position of a robotic arm is determined by an angle that can only take values between - 6 0 degrees and + 1
Description
The position of a robotic arm is determined by an angle that can only take values between
degrees and degrees included In this homework, you will create a C class Angle that
represents the angle of the robotic arm. The implementation should enforce the limits on the
range of allowed values. The angle can only take integer values. Any attempt to change the angle
beyond a limit should result in the angle value being that limit For example, any attempt to
change the angle to a value smaller than should result in the angle value being
The class Angle includes a public member function changeint dt and a private member
function setint t The change function uses the set function to change the angle by the
amount dt The argument dt may be positive or negative. The initial angle value at the time
the robotic arm is powered up is degrees. The Angle object should set its angle value to be
when the object is created. See the file Angle.h for details and other member functions.
The Angle class is used by a program robot.cpp that is provided. The output of the program
robot must reproduce exactly the contents of the file robot.out.
The files Angle.h and robot.cpp are provided and must not be modified. You must create a
file Angle.cpp containing the implementation of your Angle class. It must be possible to
compile the program robot.cpp to generate an executable named robot using the command:
make
without generating any warning message. The Angle class that you provide will also be
compiled and linked with another program that uses the Angle member functions when grading
the assignment. You must create a Makefile that contains a target robot and a target
clean. The target robot should appear first and will be used to build the executable robot.
The target clean will be used to remove all object files and executables. The Makefile
should include the necessary definition to compile C files using g with the Wall option.
Submission
Create a tar file named hwptar containing the files Angle.cpp and Makefile only.
Do not compress the tar file. Include your name and Student ID in a comment at the top of each
file. Submit your tar file hwptar using Gradescope.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started