Write a java file called RecursiveMethods and provide the following methods (the
ID: 3636128 • Letter: W
Question
Write a java file called RecursiveMethods and provide the following methods (thesemethods are required to be fully recursive in that they contain no loops at all):
1) Write a recursive method that takes as input a String S and returns the number
of uppercase letters in S.
2) Write a recursive method that finds the number of occurrences of a specified
letter in a string using the following method header:
public static int count(String str, char a)
3) Write a method that checks if the first n elements of an array a of integers are
already in ascending order:
public static Boolean isSorted(int [] a, int n)
This method does not modify the contents of the array a in any way, but
simply checks if the elements are sorted or not.
4) Write a method that takes as input a string s and returns the same string where
the vowels have been removed.
public static String NoVowel(String str)
For simplicity, assume that you already have a method Boolean isVowel(char c)
that tells whether the character c is a vowel.
Provide a main method to test all the above methods.
note: do not use any loops, it must be recursive
Explanation / Answer
I would have pasted the code here... But it's a nasty paste!
edit:
Note to question creater.
--Tell me if a certain part messes up, it souldn't but ya never know eh?
Most recent edit:
New code is on here. Code will be posted below as well. [Wasn't at home so I didn't fully test it before]
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.