Question: Question 2: (20 marks) a- Write a complete Java program that includes a recursive java method countChar that takes a character and a string as

Question 2: (20 marks) a- Write a complete Java program that includes a recursive java method countChar that takes a character and a string as arguments and finds the number of occurrences of that character in the string. You should include in your answer a screenshot that shows the program and the output provided that the given character s should be equal to your first name initial letter, and the string should be your name (consider all characters are lower case). For example, if your name is abdallah, then a is the char and abdallah is the string that should be used. (14 marks) b- Using the above method, show all the recursive steps (composition and decomposition), if we call countChar('s', 'Sessions"). (6 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
