Minimum
Write a function min that takes two arguments and returns their minimum.
|
|
Recursion
Define a recursive function isEven corresponding to this description. The function should accept a number parameter and return a Boolean.
|
|
Bean Counting
Write a function countBs that takes a string as its only argument and returns a number that indicates how many uppercase “B” characters are in the string.
Next, write a function called countChar that behaves like countBs, except it takes a second argument that indicates the character that is to be counted (rather than counting only uppercase “B” characters). Rewrite countBs to make use of this new function.
|
|