Question: Please code in c++! Thank you 1. (12 pts) Write a recursive function that takes as an input parameter a number. It then prints out
Please code in c++! Thank you
1. (12 pts) Write a recursive function that takes as an input parameter a number. It then prints out an x as follows: if the input parameter is a 5, the following would be printed out:
* *
* *
* *
* *
*
* *
* *
* *
* *
Note: for this function, I suggest you write a helper recursive function that just prints out one line.
2. (5 pts) A word is considered elfish if it contains the letters: e, l, and f in it, in any order. For example, we would say that the following words are elfish: whiteleaf, tasteful, unfriendly, and waffles, because they each contain those letters.
Write a predicate function called elfish? that, given a word, tells us if that word is elfish or not. The function should take as input a string (and at least one other parameter) and return a Boolean value.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
