Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[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]
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.5a. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started