Question: 2 9 . 1 ) Renting Function Create a function named can _ rent that takes in two parameters: age and has _ license, in
Renting Function
Create a function named canrent that takes in two parameters: age and
haslicense, in that order. Then, use your logic from codegrinder drill #
as the function's body. The only difference in the logic here is that you should
now return strings instead of printing them. Call the function with your own
information or make it up and unit test it multiple times. Note that you will
need to get full test coverage think of many different test cases so that your
unit tests try out every path through the code!
Here is the logic from #:
if you are or older
if you are less than years old
if you have a license
then return "Can rent a car"
otherwise
then return "Doesn't have a license"
otherwise
then return "Too old"
otherwise
then return "Too young"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
