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
kow [346]
3 years ago
14

Here is the API for a robot library. // moves the robot forward function moveForward(); // turns the robot to the left function

rotateLeft(); // turns the robot to the right function rotateRight(); // checks if a robot can move in any direction // direction {string} - the direction to be checked // return {Boolean} - true if the robot can move in that direction, otherwise returns false function canMove(direction); Which code segment will guarantee that the robot makes it to the gray square without hitting a wall or a barrier (black square)
Computers and Technology
1 answer:
kupik [55]3 years ago
5 0

Answer:

Option (A)

Explanation:

See attachment for options

From the options, the code segment of option (A) answers the question and the explanation is as follows:

I added a second attachment which illustrates the movement

function (solveMaze) {

moveForward(); ---- The robot moves up (to position 1)

moveForward(); ---- The robot moves up (to position 2)

rotateRight(); ---- The robot changes where it faces (however, it is still at position 2)

<em>while(canMove("forward")) { moveForward(); } </em>---- This is repeated until the robot reaches the end of the grid (i.e. position 3 and 4)

rotateLeft(); ---- The robot changes where it faces (however, it is still at position 4)

moveForward(); ---- The robot moves up to the gray square

You might be interested in
20.
Kazeer [188]

Answer:

Megabyte

Explanation:

Megabytes come before Gigabytes like how Gigabytes come before Terrabytes

8 0
3 years ago
Write a function that takes, as an argument, a list, identified by the variable aList. If the list only contains elements contai
Genrish500 [490]

Answer:

The function is as follows:

def concList(aList):

   retList = ""

   for i in aList:

       if(str(i).isdigit()):

           retList+=str(i)

       else:

           retList = "Not digits"

           break;

   return retList

Explanation:

This defines the function

def concList(aList):

This initializes the return string to an empty string

   retList = ""

This iterates through aList

   for i in aList:

This converts each element of the list to an empty list and checks if the string is digit

       if(str(i).isdigit()):

If yes, the element is concatenated

           retList+=str(i)

If otherwise

       else:

The return string is set to "No digits"

           retList = "Not digits"

And the loop is exited

           break;

This returns the return string

   return retList

5 0
4 years ago
What is the function below Missing?
Nat2105 [25]

Answer:

I think a closing bracket.. sorry if its wrong.

Explanation:

3 0
3 years ago
Read 2 more answers
True of False - use T or F An abstract class can have instances created using the constructor of the class.
Sindrei [870]

Answer:

False

Explanation:

An instance of an abstract class cannot be created through the constructor of the class, because it does not have a complete implementation. Though, it is possible to have references of an abstract type class. Abstract classes are incomplete structures and you would have to build onto it before you are able to use it.

7 0
4 years ago
1
Dimas [21]

Answer:

C.  

Explanation:

Plato users

8 0
3 years ago
Other questions:
  • 3. Which one of the following statements is true for spell checkers?
    11·1 answer
  • For a Windows laptop, what is the best way to save power when the computer will not be used for an extended period?
    14·2 answers
  • Which of the following is a hardware component used to hold the BitLocker encryption key and ensures encrypted data is not acces
    5·1 answer
  • You can divide the code for an application into logical parts by moving some of the code from the main() method to other _______
    8·1 answer
  • The keyboard shortcut to enter the current date in a field is
    11·1 answer
  • Which of these conclusions supports the fact that Eclipse is categorized as an IDE?
    8·1 answer
  • Name the contributory components that are considered when determining an E/M code; they are not considered key components:
    15·1 answer
  • Solve the equation.<br>| 11 X 12362​
    14·1 answer
  • What is a wiki website?
    11·1 answer
  • (Synchronized threads) Write a program that launches 1000 threads. Each thread adds a random integer (ranging from 1 to 3, inclu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!