Question: This problem is asking for me to write a method in the SentenceCounter class that will pass the test in the images above. Off the

 This problem is asking for me to write a method in

This problem is asking for me to write a method in the SentenceCounter class that will pass the test in the images above.

Off the End of the String Again This blankPosition () method is Test void testBlankPositionTooFar () walking through a string, so, again, we need to think about assertEquals(1, sci.blankPosition( what would happen if it walked off the end of the string. Let's write a test so that we can see what is happening now: In this test, sc1 doesn't contain four blanks, so we need our method to signal that it didny find what we were looking for. As before, we'll make it return -1 as that signal. Run the te if you didn't think about this as you wrote the code, it will be RED. (If it isn't red, you didnt write the simplest code that would make our previous test pass!). The changes you need to make are very similar to the ones you made in firstBlank (). Get to GREEN and REFACTOR as appropriate

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!