1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SVEN [57.7K]
2 years ago
8

(4 points.) Write an algorithm (i.e., step-by-step instructions) via which someone could walk or drive from some origin to some

destination, perhaps a path that you yourself tend to travel. Take care to specify what the origin and destination that you have in mind. And take care to use loops and conditions as needed, particularly if there might be obstacles (e.g., red lines). Assume that your algorithm will be executed by a robot (or lost friend) who will follow your directions precisely, so avoid ALL ambiguity!
Computers and Technology
1 answer:
Elis [28]2 years ago
5 0

Answer:

The algorithm is as follows :

1. Record Current Position, Final Destination

2. While Current Position is not Final Destination, repeat the following:

2.1 If destination location is up then:

  2.1.1 If an obstacle is directly above you then:

     2.1.1.1 Look for alternate position (left, right, down)

     2.1.1.2 If alternate position is found then

        2.1.1.2.1 Move there

        2.1.1.2.2 Record Current Position

     2.1.1.3 If no alternate position is found then

        2.1.1.3.1 Call for help

        2.1.1.3.2 End

  2.1.2 If no obstacle is directly above you then:

     2.1.2.1 Move up

     2.1.2.1 Record Current Position

2.2 If destination location is down then:

  2.2.1 If an obstacle is directly below you then:

     2.2.1.1 Look for alternate position (left, right, up)

     2.2.1.2 If alternate position is found then

        2.1.1.2.1 Move there

        2.2.1.2.2 Record Current Position

     2.2.1.3 If no alternate position is found then

        2.2.1.3.1 Call for help

        2.2.1.3.2 End

  2.2.2 If no obstacle is directly below you then:

     2.2.2.1 Move down

     2.1.2.1 Record Current Position

2.3 If destination location is right then:

  2.3.1 If an obstacle is directly by your right then:

     2.3.1.1 Look for alternate position (down, up, left)

     2.3.1.2 If alternate position is found then

        2.3.1.2.1 Move there

        2.3.1.2.2 Record Current Position

     2.3.1.3 If no alternate position is found then

        2.3.1.3.1 Call for help

        2.3.1.3.2 End

  2.3.2 If no obstacle is directly by your right then:

     2.3.2.1 Move right

     2.3.2.1 Record Current Position

2.4 If destination location is left then:

  2.4.1 If an obstacle is directly by your left then:

     2.4.1.1 Look for alternate position (down, up, right)

     2.4.1.2 If alternate position is found then

        2.4.1.2.1 Move there

        2.4.1.2.2 Record Current Position

     2.4.1.3 If no alternate position is found then

        2.4.1.3.1 Call for help

        2.4.1.3.2 End

  2.4.2 If no obstacle is directly by your left then:

     2.4.2.1 Move left

     2.4.2.1 Record Current Position

Explanation:

<em>The algorithm is straight forward.</em>

<em>All it does is to check for available position and move into the position if there is any available.</em>

<em>It keeps checking and moving until an obstacle prevents it from moving.</em>

You might be interested in
The function that overloads the ____ operator for a class must be declared as a member of the class.
ira [324]

It is necessary to declare the function as a member of the class that overloads the ->c operator for the class.

<h3>What does C's -> operator mean?</h3>
  • In C/C++, the Arrow operator makes it possible to access items in unions and structures.
  • It is used in conjunction with a pointer variable pointing to a union or structure.
  • As demonstrated below, the arrow operator is created by utilizing a negative sign and the greater than symbol.
  • (Pointer name)->(Variable Name) is the syntax.
  • To access members of a class, structure, or union using a pointer, use the -> (arrow) operator.
  • A member of the object to which the pointer points is designated by a postfix expression, a -> (arrow) operator, followed by a potential qualified identifier or a pseudo-destructor name.

Therefore the correct answer is, c. ->

The complete question is:

The function that overloads the ____ operator for a class must be declared as a member of the class.

a. ::

b. *

c. ->

d. +

To learn more about -> operator, refer to:

brainly.com/question/13814474

#SPJ4

7 0
2 years ago
Heelp my brainly stuff says i am 49 but im 11 how to fix?X??
stich3 [128]

Make another account. But u cant get into brainly unless u r over 26 or something.

6 0
3 years ago
A(n ________ is a program that is used to create, process, and administer a collection of self-describing integrated records.
babymother [125]
V
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ
3 0
3 years ago
What is the least number of bits you would need to borrow from the network portion of a Class B subnet mask to get at least 130
Tatiana [17]

Answer: Eight

Explanation:

A class B address is 255.255.0.0. We need to borrow 8 bits from the network portion to have atleast 130 host per subnet.

11111111.00000000.00000000.00000000

8 0
3 years ago
What is the difference between HTML and CSS? * 1. CSS is a markup language unlike HTML. 2. HTML is a backend technology and CSS
GarryVolchara [31]
The anserw is the third one. 
5 0
3 years ago
Read 2 more answers
Other questions:
  • Heatsinks used to protect cpus in computers from overheating, are shaped so that their surface area is very large. why is that?
    5·1 answer
  • To move to the most extreme right cell containing data in your worksheet, what basic key combination can you use?
    7·1 answer
  • La inteligencia o unidad lógica de un computador se denomina como??? Software, Hardware CPU o que, ayuda.....
    7·1 answer
  • How to eject a flash drive from chromebook?
    6·1 answer
  • Which osi reference model layer includes all programs on a computer that interact with the network?
    13·1 answer
  • What weight pencil is recommended for darkening lines and for lettering? *
    7·2 answers
  • Which of the following best describes a toolbar?
    7·1 answer
  • A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county s
    11·1 answer
  • 100 tickets are sold in a raffle with one prize. John has 8 tickets, Jamie has 10 tickets, find the probability that John wins
    11·2 answers
  • In what situations might you need to use a function that calls another function?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!