Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am stuck on exercises 2,3, and 4 Exercise 2 Rob sits in a chair four steps away from a table. A ball is resting

I am stuck on 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. O Rob the Mechanical Man Double-click to remove a Double-click to select an instruction: Algorithm: Instruction Set: drop the toy in the box (inside looplselection) drop the toy in the box (outside looplselection) fix the chair (inside looplselection) fix the chair (outside looplselection) 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 looplselection) pick up the ball (outside loop|selection) pick up the flower with your right hand (inside looplselection pick up the flower with your right hand (outside looplselectio pick up the flower with your left hand (inside looplselection) pick up the flower with your left hand (outside looplselection Exercise 1 Exercise 2 Exercise 3 Exercise 4 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 loopselection) pick up the ball (outside loop|selection) pick up the flower with your right hand (inside looplselection pick up the flower with your right hand (outside loopselectio pick up the flower with your left hand (inside looplselection) 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 looplselection) stand (outside looplselection) turn (inside looplselection) turn (outside looplselection) 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_2

Step: 3

blur-text-image_3

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

More Books

Students also viewed these Databases questions

Question

What magazine and ads did you choose to examine?

Answered: 1 week ago