function name: cap_at_100 o parameters: a number grade • returns: the grade with a maximum of 100 o behavior: This function normalizes grades. If a student does a lot of extra credit they may have a final grade that is greater than 100, but we need to bring that down to 100 for the final grade. If the grade is <= 100 we don't need to change anything. ex: cap_at_100(75) returns 75, and cap_at_100(103) returns 100 function name: bound_0_to_100 o parameters:a number grade o returns: the grade with a minimum of 0 and a maximum of 100 o behavior: In addition to exceeding 100, sometimes a grade will be so spectacularly bad that it falls below 0. In that case we want to normalize it to 0 so all grades fall into the range [0, 100]. ex: bound_0_to_100(75) returns 75, bound_0_to_100(103) returns 100, and bound_0_to_100(-5) returns 0 function name: sum_range • parameters: two numbers, a start and a stop o returns: the sum of numbers in the range [start, stop) o behavior: sums the values in the range excluding the stop but including the start. ex: sum_range (3, 7) returns 3+4+5+6, which is 18 function name: pizza_total o parameters: a number num_pizzas and a bool is_delivery • returns: The total for a pizza order o behavior: Each pizza costs $12 and delivery costs $4. If is_delivery is True, you should add a delivery charge to the total. ex: pizza_total(2, True) returns 28 (12*2 +4), and pizza_total(3, False) returns 36 (12 3) function name: is_even o parameters: a number n o returns: True if n is even (n is a multiple of 2), False otherwise o behavior: ex: is_even(4) is True, and is_even(7) is False function name: is_divisble_by o parameters: two numbers, num and a divisor o returns: True if num is divisible by divisor, False otherwise o behavior: Much like is_even, but rather than checking if it is divisible by 2, check if the number is divisible by divisor. ex: is_divisible_by (9,4) is False, and is_divisible_by (9, 3) is True
function name: cap_at_100 o parameters: a number grade • returns: the grade with a maximum of 100 o behavior: This function normalizes grades. If a student does a lot of extra credit they may have a final grade that is greater than 100, but we need to bring that down to 100 for the final grade. If the grade is <= 100 we don't need to change anything. ex: cap_at_100(75) returns 75, and cap_at_100(103) returns 100 function name: bound_0_to_100 o parameters:a number grade o returns: the grade with a minimum of 0 and a maximum of 100 o behavior: In addition to exceeding 100, sometimes a grade will be so spectacularly bad that it falls below 0. In that case we want to normalize it to 0 so all grades fall into the range [0, 100]. ex: bound_0_to_100(75) returns 75, bound_0_to_100(103) returns 100, and bound_0_to_100(-5) returns 0 function name: sum_range • parameters: two numbers, a start and a stop o returns: the sum of numbers in the range [start, stop) o behavior: sums the values in the range excluding the stop but including the start. ex: sum_range (3, 7) returns 3+4+5+6, which is 18 function name: pizza_total o parameters: a number num_pizzas and a bool is_delivery • returns: The total for a pizza order o behavior: Each pizza costs $12 and delivery costs $4. If is_delivery is True, you should add a delivery charge to the total. ex: pizza_total(2, True) returns 28 (12*2 +4), and pizza_total(3, False) returns 36 (12 3) function name: is_even o parameters: a number n o returns: True if n is even (n is a multiple of 2), False otherwise o behavior: ex: is_even(4) is True, and is_even(7) is False function name: is_divisble_by o parameters: two numbers, num and a divisor o returns: True if num is divisible by divisor, False otherwise o behavior: Much like is_even, but rather than checking if it is divisible by 2, check if the number is divisible by divisor. ex: is_divisible_by (9,4) is False, and is_divisible_by (9, 3) is True
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
python
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 6 images
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY