Design Classes for Alexa Devices with Varying Hardware Capabilities
Design a set of classes to model various Alexa devices that differ in hardware capabilities (speaker, screen/display, battery). The system must report the current power/battery status to the user through the appropriate output channels based on each device's hardware configuration — spoken response if the device has a speaker, displayed response if it has a screen, or both. Devices without a battery report wall power status; devices with a battery report charge level and charging state. For example, a tablet with a speaker, display, and battery currently charging at 75% should return both a 'say' and 'display' field with the message 'Current battery level is 75% and charging', while an Echo Dot with only a speaker and no battery should return only a 'say' field with 'Currently plugged into wall power'.
Asked at:
Amazon