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
3.29 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-di
romanna [79]

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   string fname,lname; int num;

   cout<<"Firstname: "; cin>>fname;

   cout<<"Lastname: "; cin>>lname;

   cout<<"4 digits: "; cin>>num;

   string login = lname;

   if(lname.length()>=5){

       login = lname.substr(0, 5);    }

   login+=fname.substr(0,1)+to_string(num%100);

   cout<<login;

   return 0;

}

Explanation:

See attachment for explanation where I used comments to explain each line

Download cpp
4 0
2 years ago
Hillary’s family is thinking of relocating to a different city to save money. They set up a budget comparing the cost of living
vova2212 [387]

Answer: Oakland, and also a city they feel is the safest + best for there family

Explanation:

3 0
2 years ago
Choose the term that completes the sentence.
klio [65]

Answer: BUBBLE SORT

I hope I've been helpful to you.

6 0
3 years ago
Read 2 more answers
Which branch of science helps avoid or minimize stress-related injuries at workplace
dybincka [34]

The answer is : Ergonomics .   It is about ensuring that the work system is favorable to good performance and work effectiveness and consequently,  that the work environment is compatible with the health, safety and comfort of the worker.  It reduces hazards in the working environment.

8 0
3 years ago
You're shopping for a new router and are attracted by the advertising for a 600N model. Upon examining the specifications, you s
tester [92]

Answer:

Dual

Explanation:

When a router is said to transmit 300+300 mbps it simply means that it is using Dual broadcast channels or dual bands. a great advantage of using the dual broadcast channel router is that, it allows you switch or chose between frequencies therefore providing less congestion.  It provides speed and accommodates wide ranges of devices to connect.

7 0
3 years ago
Other questions:
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • What was the original intention for the creation of ARPANET?
    15·2 answers
  • ____ is a utility that can verify that TCP/IP is installed, bound to the NIC, configured correctly, and communicating with the n
    11·1 answer
  • When users talk about font size,
    10·2 answers
  • Which of the following statements about email is true?
    5·1 answer
  • Identify the terms associated with the given statements below;
    6·1 answer
  • Suppose that in a 00-11 knapsack problem, the order of the items when sorted by increasing weight is the same as their order whe
    8·1 answer
  • Is there any website online to use android studio live?​
    11·1 answer
  • Write a program that creates a two-dimensional array named height and stores the following data:
    15·2 answers
  • What is best defined as a phishing email that is targeted directly at you?.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!