CST338 - Week 9 & 10
Week 9 - New Course CST338
Week 10 - CodingBat Work Reflection
The major challenges for the codingBat homework that I encountered started in String-2. xyzThere was where it started to go downhill for me. I find creating a loop that contains the correct length a bit hard for my head to wrap around. I tried a few different methods: first, a single for loop to check if .xyz existed. It then spiraled into multiple separate for loops to find xyz, then .xyz, checking if .xyz is at the end, etc. I settled on looking up the function .endsWith() and .contains() to simplify the process, arriving at a much simpler answer. Throwing for loops at everything sometimes isn't the right answer. I took a while on this problem before solving it with 2 very simple if statements. (image below)
I planned on completing more than 3 stars for this section, but I decided to work on other assignments instead. Ultimately, I do wish to complete all the stars in the CodingBat site by the end of this course.
Isopod Update: I got white sharks for a great deal! They are super tiny, I hope they do well in their new home.
Comments
Post a Comment