/
anton.buldygin
/
Contacts_Java
Обзор
Документация
Войти
/
anton.buldygin
/
Contacts_Java
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Topics/Command/Remote control/task.html
12 строк
1 KB
AntonBuldygin
Initial commit
19 дек 2023, 15:38
19 дек 2023, 15:38
bed9366
Код
Авторство
О чём код?
<h2>Remote control</h2> <div class="step-text"> <p></p> <p>Suppose you are building a remote control application. It performs three commands: turning on the TV, changing the channel to a specific number, and turning off the TV. Use the command pattern to implement this application. </p> <p>Use the following guidelines. </p> <ul> <li>Don't change the provided code.</li> <li>The first command to execute is to turn on the TV. The <code class="java">TurnOn</code> command must print <code class="java">Turning on the TV</code>.</li> <li>Next, change channels to the inputs given by the user. The user must give only three inputs. The <code class="java">ChangeChannel</code> command will print <code class="java">Channel was changed to X</code>. X is the number given by the user. </li> <li>The last command is to turn off the TV. The <code class="java">TurnOff</code> command must print <code class="java">Turning off the TV</code>.</li> </ul><br><b>Sample Input:</b><br><pre><code class="language-no-highlight">4 7 12</code></pre><br><b>Sample Output:</b><br><pre><code class="language-no-highlight">Turning on the TV<br>Channel was changed to 4<br>Channel was changed to 7<br>Channel was changed to 12<br>Turning off the TV</code></pre><br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 5 seconds</font><br><br> </div>