Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Iv Special Issue On Database Systems For Biomedical Applications Lncs 6990

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Christian Bohm ,Johann Eder ,Claudia Plant

2011th Edition

3642237398, 978-3642237393

More Books

Students also viewed these Databases questions