Object-Oriented Programming with Java, part I – Exercise 55

This program compares two words to see if the first one is inside the second one and then prints the result. My Code Model Code Comments Mine is pretty much the same as the Model Code except that this time I have introduced a new variable to make it easier to read and they have […]

Object-Oriented Programming with Java, part I – Exercise 54

This program takes an inputted string and then an integer and outputs the last characters of the word dependent on the integers size. My Code Model Code Comments My code is relatively the same as the model code except it introduces a new variable (startingPosition) to hold the value of word.length() – lengthOfEnd where mine […]

Object-Oriented Programming with Java, part I – Exercise 53

In this program a user inputs a string and then the amount of characters of that string they want to print. The characters are then output. My Code Model Code Comments Oops. That was a perfect example of not reading the instructions enough. I used the substring() method as requested but failed to read that […]