example code for question 4 on page 44
replacing blanks with %20 given input char array