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 …

Read moreObject-Oriented Programming with Java, part I – Exercise 54

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 …

Read moreObject-Oriented Programming with Java, part I – Exercise 53

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

This program takes user input and then uses a loop to print the first three characters of the input. If there are less than three characters it outputs nothing. My Code Model Code Comments Although achieving the same result I quite like a few things about the model code that I don’t have in mine. …

Read moreObject-Oriented Programming with Java, part I – Exercise 50