CS106B Assignment 1

Problem #1:  Removing all occurrences of a character in the following ways:

  • changes user input source text by removing specified user input text.
  • changes a copy of the user input text by removing the specified input text.

Here, I wrote most of the code myself (all except the important bits). Here I tried to figure out what they did.  Besides a “{” in the wrong place in CensorString1 that was producing whacky output, the biggest bug what in CensorString2.  Despite the code being exactly what the solution said it was (I’ve gone over it 10x to make sure), “o” was being removed from the source.  Why?

The positive from this at least is I wrote an entire program, not just the functions before I looked at the solution to figure out the nitty gritty.

CS106B Assignment 1 Part 1 - buggy and I cannot see why... :/

CS106B Assignment 1 Part 1 – buggy and I cannot see why… :/

What is a tad frustrating about this is on the first loop, the “o” is removed. On subsequent CensorString2 function calls, it works as expected!  I determined that “o” was removed regardless of the sRemove string and that this string did not contain the character “o”.  Hmmm.

Problem 2: Files and Structs

This is done.

Problem 3: Vectors

This is in progress and it was completed as part of Assessment 1.

Problem 4: Memory Diagram.

Did not do.