public class AdvancedRemoteControl extends RemoteControl { public AdvancedRemoteControl(Device device) { super(device); } // 1. Η υπάρχουσα λειτουργία σίγασης public void mute() { System.out.println("Advanced Remote: Setting device to silent mode."); device.setVolume(0); } // 2. Νέα λειτουργία: Επόμενο κανάλι public void nextChannel() { int currentChannel = getChannel(); setChannel(currentChannel + 1); System.out.println("Advanced Remote: Next Channel."); } // 3. Νέα λειτουργία: Προηγούμενο κανάλι public void previousChannel() { int currentChannel = getChannel(); if (currentChannel > 1) { setChannel(currentChannel - 1); System.out.println("Advanced Remote: Previous Channel."); } } // 4. Νέα Macro λειτουργία: Cinema Mode (Συνδυασμός ενεργειών) public void cinemaMode() { System.out.println("Advanced Remote: Enabling Cinema Mode..."); if (!device.isEnabled()) { device.enable(); } device.setVolume(80); // Δυνατός ήχος για ταινίες device.setChannel(10); // Υποθέτουμε ότι το κανάλι 10 είναι για ταινίες System.out.println("Advanced Remote: Cinema Mode is Ready!"); } }