Question: Implement a static function String remove (String s, Character c) that, given a string s and a character c, returns a new string equivalent to

Implement a static function String remove (String s, Character c) that, given a string s and a character c, returns a new string equivalent to string s without any occurence of character c. Hint: Objects of type String look like "abcdbcd" while objects of type Character look like 'a'. Example: remove("abcdbcd", 'C') = "abdbd" = Implement a static function Character mostFrequent(String s) that, given a string s, returns the most frequent character appearing string s. In case of a tie, the fuction must return the first character appearing from the left among the most frequent ones. If needed, you can call the function in the previous exercise. Example: mostFrequent("abcdbcd") = 'b' Implement a static function Character secondMost Frequent (String s) that, given a string s, re- turns the second most frequent character often in string s. In case of a tie on the most frequent one, the fuction must return the second character appearing from the left among the most frequent ones. If there is a unique most frequent character, but a tie occurs on the second most frequent, the fuction must return the first character appearing from the left among the second most frequent ones. If needed, you can call the functions in the previous exercises. = Example: secondMost Frequent("abcdbcd") = 'C' Example: secondMost Frequent ("abbcdbcd") = 'c' =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
