CS1011
Homework
There are four sources for the homework problems: * [CodingBat](http://codingbat.com) assignment (with link to assignment provided). * Exercise: 3.4 means exercise number 4 at the end of chapter 3. * Instructor written assignment. ## Week 1 (doable by Tuesday of week 2) * Write a paragraph or code snipet that demonstrates attainment of each Week 1 [outcome](Outcomes) * Exercise 3.4 ## Week 2 (doable by end of week 2) Note: You'll need to [create an account on the CodingBat](http://www.codingbat.com/pref?docreate=1) site (make sure you enter your name in the Name field (even though it says it is optional). You will also need to put your instructor's email address in the "Share To" field (see [preferences](http://www.codingbat.com/pref)). ([5 minute tutorial video](../cs1011f10/1011-hw.html)) * Write a paragraph or code snipet that demonstrates attainment of each Week 2 [outcome](Outcomes) * [CodingBat: sum](http://www.codingbat.com/prob/p214024) * [CodingBat: helloName](http://www.codingbat.com/prob/p171896) * [CodingBat: makeAbba](http://www.codingbat.com/prob/p161056) * Exercise: 2.5 (long form only) * Download [this file](https://raw.githubusercontent.com/bcdennis/se1011/be5786d5d1eae27bf6dc25836a7827c8729ada8b/src/Strings.java). For each part, first predict what you think will be displayed, then run the code (commenting/uncommenting as needed) and verify your prediction. * Download [this file](https://raw.githubusercontent.com/bcdennis/se1011/cb2a5f113bf7a530dc1276f20c0f77b0f31b29d6/src/Arithmetic.java). For each part, first predict what you think will be displayed, then run the code (commenting/uncommenting as needed) and verify your prediction. * Write a program that will initialize a variable named `myHelloWorld` with the string literal `"My Hello World"` and print to the console the index of the letter <kbd>H</kbd>. * Write a program that will initialize a variable named `firstName` with your first name. Without using loops, print to the console each letter in your name on a separate line by using the `charAt()` method. * Using the [String class documentation](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), explain what the `replace()` method does and write a program to demonstrate its usefulness. * Using the [String class documentation](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html), explain what the `trim()` method does and write a program to demonstrate its usefulness. ## Week 3 (doable by end of week 3) * Write a paragraph or code snipet that demonstrates attainment of each Week 3 [outcome](Outcomes) * [CodingBat: comboString](http://www.codingbat.com/prob/p168564) * [CodingBat: sortaSum](http://www.codingbat.com/prob/p183071) * [CodingBat: alarmClock](http://www.codingbat.com/prob/p160543) * [CodingBat: twoAsOne](http://www.codingbat.com/prob/p113261) * [CodingBat: inOrder](http://www.codingbat.com/prob/p154188) * [CodingBat: bobThere](http://www.codingbat.com/prob/p175762) ([video solution](../se1011f14/1011-3-hw)) * [CodingBat: starOut](http://www.codingbat.com/prob/p139564) ([video solution](lectures/1011-3-hwb.mp4)) ## Week 4 (doable by Tuesday of week 4) * [CodingBat: closeFar](http://www.codingbat.com/prob/p138990) * [CodingBat: makeChocolate](http://www.codingbat.com/prob/p191363) ([video solution](lectures/1011-4-hw.mp4)) * [CodingBat: sumDigits](http://www.codingbat.com/prob/p197890) * [CodingBat: middleThree](http://www.codingbat.com/prob/p115863) * Exercise: 4.9, 5.5 ## Week 5 (doable by Friday of week 5) * Write a paragraph or code snipet that demonstrates attainment of each Week 4 [outcome](Outcomes) * Write a paragraph or code snipet that demonstrates attainment of each Week 5 [outcome](Outcomes) * Exercise: 5.3, 5.7, 5.8 ## Week 6 (doable by Friday of week 6) * Write a paragraph or code snipet that demonstrates attainment of each Week 6 [outcome](Outcomes) * Exercise: 6.6, 6.10, 6.11, 6.13, 7.2 * In the `Student` class developed in lecture, add an instance variable with [`LocalDate date`](http://docs.oracle.com/javase/10/docs/api/java/time/LocalDate.html). Hint: `java.time.temporal.ChronoUnit.YEARS.between(a, b);` returns the number of years between two `LocalDate`s. ## Week 7 (doable by Thursday of week 7) * Write a paragraph or code snipet that demonstrates attainment of each Week 7 [outcome](Outcomes) * Exercise: 7.2, 7.7 ## Week 8 (doable by on Tuesday of week 8) * Write a paragraph or code snipet that demonstrates attainment of each Week 8 [outcome](Outcomes) * Exercise: 9.9 * Implement `calculateTermQuizScore()` that accepts an array of `int`s as an argument and returns a `double` representing the quiz grade for the quarter. ## Week 9 (doable by Friday of week 9) * Exercise: 10.7, 10.9, 10.10 * [CodingBat: lucky13](http://www.codingbat.com/prob/p194525) * [CodingBat: sum28](http://www.codingbat.com/prob/p199612) * [CodingBat: centeredAverage](http://www.codingbat.com/prob/p136585) * The above centeredAverage problem with an ArrayList instead. (`public int centeredAverage(ArrayList<Integer> nums)`) * [CodingBat: linearIn](http://www.codingbat.com/prob/p134022) * Exercise: 10.10 * Write a paragraph or code snipet that demonstrates attainment of each Week 9 [outcome](Outcomes) * [CodingBat: shiftLeft](http://www.codingbat.com/prob/p105031) * [CodingBat: tripleUp](http://www.codingbat.com/prob/p137874) * [CodingBat: seriesUp](http://www.codingbat.com/prob/p104090) * [CodingBat: copyEvens](http://www.codingbat.com/prob/p134174) * [CodingBat: fix34](http://www.codingbat.com/prob/p159339) ## Week 10 (doable by Friday of week 10) * Write a paragraph or code snipet that demonstrates attainment of each Week 10 [outcome](Outcomes) * Redo the week 9 homework using ArrayLists instead of arrays

Wednesday, 31-Oct-2018 08:17:30 EDT