1. Engineering
  2. Computer Science
  3. write a recursive method you may add this code to...

Question: write a recursive method you may add this code to...

Question details

Write a recursive method. You may add this code to the Driver class used in problems #1 and #2.

noSpaces():

  • Input Parameter: a String
  • Returns: a new String with the spaces removed from String
  • Example: The input string "Hello World" should return "HelloWorld"

Grading Breakdown:

  • 5 points for correctly calling and testing it from the main() method (don't forget to test the base case(s))
  • 5 points for the correct method header
  • 5 points for correctly identifying and coding the base case(s)
  • 5 points for correctly identifying and coding the general case and making the recursive call
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution