Question: [Python 3.8] The brightness_modifier function is below: def brightness_modifier(n:int): -> int: if n==0: return 1.0 elif n==1 : return 0.9 elif n==2 : return 0.75

[Python 3.8]

[Python 3.8] The brightness_modifier function is below: def brightness_modifier(n:int): -> int: if

The brightness_modifier function is below:

def brightness_modifier(n:int): -> int: if n==0: return 1.0 elif n==1 : return 0.9 elif n==2 : return 0.75 else : return 0.5

a. Design a function called hours_remaining that takes three arguments: an integer value between 0 and 100 representing the percentage of battery life remaining b. the brightness level of the mobile device a boolean value representing whether or not the mobile device is currently streaming video (True means streaming video, False means not streaming video) c. The function returns a floating-point value representing the total number of hours of battery life left. The following algorithm is used to determine the number of hours of batter life left: i. Multiply the MAXIMUM_BATTERY_LIFE (15 hours) by the percentage of battery left. ii. Apply the brightness_modifier based on the current brightness level of the device. If the phone is currently streaming video, the hours remaining is cut in half. 111. = = For example, hours_remaining(80, 2, True) returns the following: 15 * 80% 12 hours of regular battery remaining (80% of maximum). 12 * 0.75 9 hours after the brightness modifier is applied (brightness level of 2) * 0.5 4.5 hours since the mobile device is currently streaming video 4.5 is returned. Do not round the result. 9 =

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!