Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ECS 3 6 B Winter 2 0 2 4 2 0 2 4 - 0 1 - 2 0 Homework 1 due Tue 2 0
ECSB Winter
Homework due Tue at :
Use Gradescope to submit your work
Problem : Robotic arm
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 change int and a private member function set int The change function uses the set function to change the angle by the amount The argument 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. 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. 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 files using with the Wall option.
Submission
Create a tar file named hwp tar 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 hwp tar 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