This problem is asking for me to write a method in the SentenceCounter class tha
ID: 3737341 • Letter: T
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 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 appropriateExplanation / Answer
//SentenceCounter.java public class SentenceCounter { private String s; public SentenceCounter(String s) { this.s = s; } public int countLowerCase(){ int count = 0; for(char ch: s.toCharArray()){ if(ch >='a' && chRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.