Question: Design a function called brightness_modifier that takes a single integer value as an argument. The integer value represents the display brightness setting on a mobile

Design a function called brightness_modifier that takes a single integer value as an argument. The integer value represents the display brightness setting on a mobile phone, and is either 0, 1, 2, or 3 (0 means the screen is off, up to 3 which means full brightness).

The function returns a floating-point value between 0.5 and 1.0 representing the modifier that the current brightness level has on the lifetime of the battery for the device. For example:

- 0 brightness means the phone will last the maximum battery lifetime (i.e. a modifier of 1.0)

- 1 brightness means the battery will last 90% of maximum battery lifetime

- 2 brightness means the battery will last 75% of maximum battery lifetime

- 3 brightness means the battery will last 50% of maximum lifetime

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!