Skip to content

Latest commit

 

History

History
16 lines (9 loc) · 641 Bytes

File metadata and controls

16 lines (9 loc) · 641 Bytes

Problem 1

Write a java program to replace certain characters from a string:
* Create one method that completes the task using iteration.
* Create one method that completes the task using recursion.

UNIT TESTING IS MANDATORY !!!

Example:

Given the following map { ‘f’ : ‘7’, ‘s’:’$’, ‘1’:’!’, ‘a’.:’@’}, your method should replace any character represented by a key in the map, with its corresponding value.

Input = “The Farmer went to the store to get 1 dollar’s worth of fertilizer” Output = “The 7@rmer went to the $tore to get ! doll@r’$ worth of 7ertilizer”