Students asked for some sample code for homework 5. I am giving, as an example, 3 files, for the last problem of the homework. (This problem had the lowest success rate.) I have renamed Bug to Bg, just to make it less search friendly. (I have done it for the filenames, as well as within the files.) I am giving the class definition, the tester that was asked for, and a better tester, which tests much more carefully that the bug should be able to "cross the zero" boundary.
Note to students who were asking me how this can be done without a conditional: this code has no if/then statement. I suspect that if you used an if/then statement, your code was more complex than this (and in some cases also incorrect, even if it passed the easy test case that labrat tested.)