Java Computer Programming. Each robot: - Has a name (attribute name: string) - Has a position: given by the integer attributes x and y. - Has a direction: given by the direction attribute that takes one of the values "North", "East", "South" or "West".
Java Computer Programming.
Each robot:
- Has a name (attribute name: string)
- Has a position: given by the integer attributes x and y.
- Has a direction: given by the direction attribute that takes one of the values "North",
"East", "South" or "West".
The name, position and direction of a robot are given to it at the moment of its creation
- Can advance one step forward: with method without parameter advance ()
- Can turn right 90 ° to change direction (if its direction was "North" it becomes "East", if
it was "East" it becomes "South", etc.): with the method without parameter right().
Robots cannot turn left.
- Can display its detail with the method detail()
Detail: name, position, and current direction.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images