Feature #8: Divide in Power Save Mode

Implement the "Divide in Power Save Mode" feature for our "Language Compiler" project.


When people want to use mobile devices for a long duration and require basic functionality like audio calls and text messages, then the power-save mode is of great help. A drawback of power-save mode is that it disables power-hungry features, which the user may sometimes need. Therefore, we want our compiler to generate an adaptive code that behaves differently under different battery conditions. When the device is in power-save mode, it generates code that will adapt to conditions. An example of an operation that is disabled in power-save mode is integer division.

Let’s see the following illustration to get an idea of the divide function:

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.