Task 1: polymorphism
A robot should be controlled remotely. Control is quite limited, the robot can move one meter forward, rotate 90º clockwise, and output a status report. The robot moves over a two-dimensional grid. It starts at position (0.0).
The robot is controlled via a MissionControl class. The program should be used as follows, for example
MissionControl control = MissionControl.create ();
control.print ();
// output: Robot is facing north at (0,0)
control.step ();
control.turn ();
control.step ();
control.step ();
control.step ();
control.step ();
control.print ();
// Edition: Robot is facing east at (4.1)
However, there are some boundary conditions. On the one hand, the implementation must be completely hidden behind MissionControl and on the other hand, you may only write linear code, i.e. all forms of control structures (if, switch, while, ...) may not be used.
| Гарантия на работу | 1 год |
| Средний балл | 4.52 |
| Стоимость | Назначаете сами |
| Эксперт | Выбираете сами |
| Уникальность работы | от 70% |