• edited by
2,714 views
0 0 votes

Answer the question based on the following information.
A robot moves on a graph sheet with X and Y-axis. The robot is moved by feeding it with a sequence of instructions. The different instructions that can be used in moving it, and their meanings are:

Instruction Meaning
GOTO (x,y) Move to point with coordinates (x, y) no matter where you are currently.
WALKX(p) Move parallel to the X-axis through a distance of p, in the positive direction if p is positive, and in the negative direction if p is negative.
WALKY(p) Move parallel to the Y-axis through a distance of p, in the positive direction if p is positive, and in the negative direction if p is negative.

The robot reaches point $(6, 6)$ when a sequence of three instructions is executed, the first of which is a GOTO(x,y) instruction, the second is WALKX$(2)$ and the third is WALKY$(4)$. What are the value of x and y?

  1. $2, 4$
  2. $0, 0$
  3. $4, 2$
  4. $2,2$

1 Answer

0 0 votes

option C (4,2)

1. We can go in reverse order first walky(4)
move parallel to y axis down by 4 (reached at (6,2)

2. now walkx(2)
move parallel to x axis left by 2 (reached at (4,2)

this is the desired point goto (4,2)

Position:
Show:

Related questions

0 0 votes
1 1 answer
2.3k
2.3k views
go_editor asked May 16, 2016
2,327 views
The question is followed by two statements I and II.Markif the question can be answered by any one of the statements alone, but cannot be answered by using the other stat...
0 0 votes
1 1 answer
2.6k
2.6k views
go_editor asked May 16, 2016
2,553 views
The question is followed by two statements I and II.Markif the question can be answered by any one of the statements alone, but cannot be answered by using the other stat...
0 0 votes
1 1 answer
2.1k
2.1k views
go_editor asked May 16, 2016
2,054 views
The question is followed by two statements I and II.Markif the question can be answered by any one of the statements alone, but cannot be answered by using the other stat...
0 0 votes
1 1 answer
2.1k
2.1k views
go_editor asked May 16, 2016
2,063 views
The question is followed by two statements I and II.Markif the question can be answered by any one of the statements alone, but cannot be answered by using the other stat...
0 0 votes
1 answers 1 answer
2.4k
2.4k views
go_editor asked May 16, 2016
2,430 views
The question is followed by two statements I and II.Markif the question can be answered by any one of the statements alone, but cannot be answered by using the other stat...