Question: Write the Java code using Recursion for following problema in the attachment Task 1 Count the number of vowels in a phrase using recursion only.
Task 1 Count the number of vowels in a phrase using recursion only. You can think of this problem as I can count the number of vowels in this phrase by counting the number of vowels in the first character, then counting the number of vowels in the rest of the phrase." We define a vowel as being A, E, 1, O or U This is one of those problems that can just as easily be solved with traditional programming structures such as a loop- but we're asking you to use recursion for the exercise. Consider: what replaces the loop structure? When will we stop recursion? Task 2 The constant e (Euler's number) is approximated by the following sequence: 1- n! 1! 2! where the number of terms in the sequence is sufficient to generate the required precision in decimal places. We say that there is some value epsilon (e) such that, when the change in the approximation from one term to the next is less than said epsilon, we have reached sufficient precision. That is, when the term you're proposing to add is less than epsilon, you don't add it - you're already there. Write a recursive program to computer Euler's Number to an epsilon of 0.0000001 Check your results using an online tool like Wolfram Alpha. You will also need a helper method to compute the factorial of a number-this should also be done recursively
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
