Question: use python IDLE when providing your solution and answer everything above 1. Compose a function called calc_bonus that accepts a single numerical argument: a sales

 use python IDLE when providing your solution and answer everything above

use python IDLE when providing your solution and answer everything above

1. Compose a function called calc_bonus that accepts a single numerical argument: a sales amount. This argument should be a positive number. If the argument is not valid, the output of the function is undefined. This function should return the bonus awarded based on the sales amount using the following logic: If the sales amount is greater than $10,000, then the bonus about is 5% of the sales amount. Otherwise, the bonus amount is only 2% of the sales amount. For example, \( \begin{array}{ll}\text { calc_bonus (15000) } & \text { \# output: } 750 \\ \text { calc_bonus (7000) } & \text { \# output: 210 } \\ \text { calc_bonus (-10) } & \text { \# output: undefined }\end{array} \) 2. Compose a function called temp_feel that accepts a single numerical argument: a temperature. This argument should be a floating point number. This function should return a string based upon the input temperature, determined using the following logic: if the temperature is less than 40, return COLD, if it is between 40 and 60 (inclusive), return CHILLY, and if it is greater than 60, return NICE. For example, \( \begin{array}{ll}\text { temp_feel }(0) & \# \text { output: COLD } \\ \text { temp_feel }(100) & \# \text { output: NICE } \\ \text { temp_feel }(60) & \text { \# output: CHILLY }\end{array} \) 3. Compose a function called floor_division that accepts two numerical arguments. It should return an integer, calculated by dividing the first argument by the second. If the division is not defined, the output of the function is undefined, but the function must not throw an error. For example, floor_division (5,2) \# output: 2 floor_division (100,20) \# output: 5

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!