Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 (these
methods 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

http://pastebin.com/sQiY6MJ7

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:

https://ideone.com/2v0vF 

http://pastebin.com/LWqqZSy7

New code is on here. Code will be posted below as well. [Wasn't at home so I didn't fully test it before]

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote