Computers and Technology
25.05.2020 20:36
259
478
7
Solved by an expert

Scenario: A robot is sitting in a chair with its arms facing down. Write an algorithm,

Scenario: A robot is sitting in a chair with its arms facing down. Write an algorithm, using pseudocode, to make the robot: 1. stand up2. walk forward until it senses a wall3. turn around4. walk back to the chair5. sit down in its original starting positionFinally, output the total number of steps taken.CommandsIn addition to our standard pseudocode commands, you must also use the following robot control commands:sitstandstep (one step forward)raise arms (parallel to floor)lower arms (pointing to floor)sense (only if arms are raised)turn (90 degrees right)Immediately after issuing a sense command, you can check whether the robot is at the wall as follows:if at wallor alternativelyif not at wallAssumptionsYou must assume the following facts:The robot's initial sitting position is directly facing the target wall.There are no obstacles between the robot and the wall.The wall is 1 or more exact steps from the chair.The wall is sensed when it is less than 1 step from the robot's arms.The length of the robot's arms are slightly less than the length of 1 step.Your solutionYour solution must include all of the following:Adequate commentsInitialization and use of at least one variableSequential flow of controlConditional flow of controlIterative flow of controlHandling of any special casesOutput of the total number of steps takenYour solutionYour solution must include all of the following:Adequate commentsInitialization and use of at least one variableSequential flow of controlConditional flow of controlIterative flow of controlHandling of any special casesOutput of the total number of steps taken
Show Answers
99keevintaylor012
99keevintaylor012
5,0(63 marks)

Solution :

\text{Algorithm to} stand $\etxt{up:}$

step 1: $\text{stand}$

step 2: \text{raise arms}

\text{Algorithm to} walk $\text{until it senses}$ a wall:

step 1: $\text{stand}$

step 2: \text{raise arms}

step 3: $\text{wallSensed}$=false

step 4: $\text{numberOfSteps}$ = 0

step 5: if($\text{wallSensed}$==true) then

\text{lower arms}

step

else

if(sense)

$\text{wallSensed}$=true;

else

step

$\text{numberOfSteps}$++;

step 6: display $\text{numberOfSteps}$ to reach the wall

\text{Algorithm to} turn around:

Step 1: if($\text{wallSensed}$==true) then

turn

\text{raise arms}

turn

 

\text{Algorithm to} walk back$\text{ to the chair}$:

Step 1: $\text{turn around}$

Step 2: for i=1 to $\text{numberOfSteps}$ do

step

\text{Algorithm to} sit back down:

Step 1: sit

Step 2: Lower arms

eriter3574
eriter3574
4,5(88 marks)

It is a method of work organization that seeks to increase productivity through the maximum division of functions, the specialization of work and the strict control of the time needed for each task.

Popular Questions about the subject: Computers and Technology

Technology trends in education play a key role in a student’s:...
Computers and Technology
02.04.2023 10:40

New questions by subject

What are the bacterial infection...
Health
22.10.2020 22:26
Why do modern directors show the Romeo and Juliet balcony scene...
English
22.07.2022 01:03
The probability of rolling a 6 on a biased dice is 1/5 work out...
Mathematics
12.10.2021 15:19
Plz help brainliest will be given...
Mathematics
20.09.2022 17:37
4 7 of students at a school are boys. If there are 2723 students...
Mathematics
10.05.2021 17:36
HELP brainliest will be given...
Mathematics
29.11.2020 15:12
2. Why should credit at reasonable rates be available for all?...
Biology
15.01.2023 06:59
What did bill sikes use to murder nancy in the book liver twist...
English
27.08.2020 17:22
#
#
#
#
# #

We expand our knowledge with many expert answers