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]
3 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]3 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
You recently started working part-time in a retail store, and are learning about the reading devices your store uses.Your store
slega [8]

Answer:

Laser beams.

Explanation:

Recently, that user has began functioning part-time in such a retail outlet, as well as he discovering regarding his shop's learning tools. During checkout, his shop requires the code scanner to scan objects.  

The barcode scanner uses laser beam technologies because the laser beam is rapidly running over the QR code or barcode back-and-forth, or executing the sequence. The sensors well into the system display the mirrored beam patterns that decrypts the barcode.

So, the following are the reason that describes the answer is correct according to the scenario.

5 0
3 years ago
What do rocket scientists mean when they say, "forces come in pairs?"
zhenek [66]
According to Newton's third law, for every action force there is an equal (in size) and opposite (in direction) reaction force.
6 0
3 years ago
Nathan would like to save his PowerPoint presentation as a video that can be replayed easily on any device at full quality. Whic
aniked [119]

Answer:

Presentation Quality

Explanation:

7 0
2 years ago
Beth would like to eavesdrop on network traffic resulting from users browsing the Web. Which port would provide her with the mos
Elis [28]

Answer:

port 80

Explanation:

port 80 is http. port 443 is https. so if you are trying to be a sneaky little person and eavesdrop on people, eavesdrop on port 80 not port 443 because port 80 is unsecured plaintext data transmission over websites

7 0
3 years ago
To light up an LED, you need to connect the cathode leg to one of the Digital Pins and connect the Anode leg to the ……………. on th
Elenna [48]

Answer bobobobobobobobo

4 0
2 years ago
Other questions:
  • Rose has a list of two columns of information separated by tabs. She wants to input this information into a table. What is the f
    15·2 answers
  • . Network navigation devices, such as routers, help datatravel in bundles that are referred toas………..
    14·1 answer
  • #include
    9·1 answer
  • 1- Which of the following is the java keyword used to declare a class?
    5·2 answers
  • Which of the following website is arguably considered the best site to search for scholarships
    8·2 answers
  • Write an HTML document which contains two text fields, a button, and a div. The first text field should be labeled “Temperature”
    10·1 answer
  • Which wireless communication is typically limited to six feet of distance?
    6·1 answer
  • What does a computer need from people in order to solve problems effectively?
    9·1 answer
  • You are the CEO of a large tech company and have just received an angry email that looks like it came from one of your biggest c
    12·1 answer
  • Carlie was asked to review a software project for her company to determine specific deadlines. Which part of project management
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!