Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

im having trouble with exercises 2,3, and 4 Exercise 2 Rob sits in a chair four steps away from a table. A ball is resting

im having trouble with exercises 2,3, and 4 image text in transcribed
image text in transcribed
image text in transcribed
Exercise 2 Rob sits in a chair four steps away from a table. A ball is resting on the table top. Using the least number of instructions from the Instruction Set list box, create an algorithm directing him to pick up the ball, and then returning him to his original position. Exercise 3 Rob faces a chair with its back to the wall. The chair is zero or more steps away from him. Using the least number of instructions from the Instruction Set list box, create an algorithm directing him to sit in the chair, but only if the chair is not broken. If the chair is broken, the algorithm should instruct him to fix the chair. Exercise 4 Rob sits in a chair facing a box zero or more steps away from him. He is holding a toy in his left hand. Using the least number of instructions from the Instruction Set list box, create an algorithm directing him to drop the toy in the box, but only if the box is not full. The algorithm should also return him to his original position. Rob the Mechanical Man Double-click to select an instruction: Double-click to remove a Algorithm: Instruction Set drop the toy in the box (inside loop selection) drop the toy in the box (outside loop selection) fix the chair (inside loop selection) fix the chair (outside loop selection) if the box is not full,then do this: (inside loop) if the box is not full, then do this: (outside loop) if the chair is broken, then do this: (inside loop) if the chair is broken, then do this: (outside loop) if the flower is red, then do this: (inside loop) if the flower is red, then do this: (outside loop) otherwise, do this: (inside loop) otherwise, do this: (outside loop) pick up the ball (inside loop selection) pick up the ball (outside loop selection) pick up the flower with your right hand (inside loop selection pick up the flower with your right hand (outside loop selectio pick up the flower with your left hand inside loop selection) pick up the flower with your left hand (outside loop selection Exercise 1 Exercise 2 Exercise 3 Exercise 4 Clear Clear Rob the Mechanical Man Double-click to remov Double-click to select an instruction: Algorithm: Instruction Set: otherwise, do this: (outside loop) pick up the ball (inside loop selection) pick up the ball (outside loop selection) pick up the flower with your right hand (inside loop selection pick up the flower with your right hand (outside loop selectio pick up the flower with your left hand (inside loop selection) pick up the flower with your left hand (outside loop selection repeat 4 times: repeat until you are directly in front of the chair. repeat until you are directly in front of the box sit (inside loop selection) sit (outside loop selection) stand (inside loop selection) stand (outside loop selection) turn (inside loop selection) turn (outside loop selection) walk (inside loop selection) walk (outside loop selection) Exercise 1 Exercise 2 Exercise 3 Exercise 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logics For Databases And Information Systems

Authors: Jan Chomicki ,Gunter Saake

1st Edition

1461375827, 978-1461375821

Students also viewed these Databases questions

Question

Why arent threats effective persuasion tools?

Answered: 1 week ago