Capgemini
Company
Numerical Ability
Co-ordinate geometry
A robot moves on a graph sheet with xy axes. 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 pt with coord (x,y) no matter where you are currently WALKX (P) move parallel to x axis through a distance of p, in the +ve direction if p is +ve and in –ve if p is –ve WALKY(P) move parallel to y axis through a distance of p, in the +ve direction if p is +ve and in –ve if p is –ve
Question: The robot reaches point (5,6) when a sequence of 3 instr. is executed, the first of which is GOTO(x,y) , WALKY(2), WALKY(4). What are the values of x and y?
A) 2,4 B) 0,0 C) 3,2 D) 2,3
Read Solution (Total 0)
Capgemini Other Question