Week 10: CST 338 Module 2

This is the tenth week of the CSUMB computer science program. 

During the week, we needed to complete a few quizzes and somewhat continue project 1, along with doing the first HW01 assignment named Markov. This week wasn't too difficult to accomplish, as I have a good grasp of programming, while relying on some of the autogenerated prompts from Intellij IDEA. Although, the hardest part of HW01 was dealing with the tests addBadLineTest and toStringTest. The two tests required very simple implementations dealing with if - else statements to check if the program was empty or wasn't correct based on the parameter. However, that was after constantly looking into each method available, which required me to test the methods within Markov with comments (//) to see if a line of code was the reason for failing the test. In the end, the methods that weren't working as intended were addWord and addLine, as the latter didn't have an else statement, thus it added an extra 'hello' to the BEGINS_SENTENCE key, while the former didn't have a proper way of checking if the line was empty, requiring an if statement to rectify the issue.

Compared to the addBadLineTest and toStringTest, the other tests were really simple to resolve, as they required simple if statements or for loops that implemented the rest of the program. These tests included the endsWithPunctuation, getSentence, and addLongLineTest.

Throughout the entire week, the Markov assignment was the thing that I'm proudest of, as the assignment itself required a basic understanding of maps, StringBuilder (I resolved this one through Intellij IDEA giving the required code), if-else statements, and for loops. I managed to implement most of the code with just the information provided within the word doc, while also resolving the problems that cropped up by combing through the code to understand what went wrong. In the end, after resolving the methods that required further implementation, I managed to have all tests pass for the HW01 assignment.

This is the second week for this course, and I'm excited for what we are going to cover throughout. 

Comments

Popular Posts