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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!