The milling machine in a manufacturing facility solution is written in python and is given below.
<h3>
The code that determines the minimum number of forward and backward moves is given as?</h3>
def toolchanger(tools, k, desiredTool):
# either we move forward or backwards in the array
# we also have to find which tool isballendmill closer
# is there a way we can re-arrange the array to
i = k
while True:
if tools[i % len(tools)] == desiredTool:
print(tools[i % len(tools)])
print("no of steps : ", i)
return True
i=i+1
if __name__ == "__main__":
tools = ["ballendmill", "hammer", "keywaycutter", "slotdrill", "facemill", "nail", "drill"]
k = 2
target = "ballendmill"
minNumSteps = toolchanger(tools, k, target)
print(minNumSteps)
Learn more about phyton at;
brainly.com/question/27666303
#SPJ1
Full Question:
"A milling machine in a manufacturing facility has a tool change system. The took changer holds tools and some duplicate 5 tools may be included. The operation mus. move through the tools one at a time, 13 14 either moving forward or backward. The tool changer is arranged circularly, so IS 15 11 when you reach the last tool in the tool changer, pressing next takes to you to beginning and vice versa. 21 Given the index of the desired tool in the tools, determine the minimum number of forward or backward moves needed to reach a certain tool."