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

This program involves two methods, sum and average. Sum returns the sum of the four numbers and average calculates the average using that sum. My Code Model Code Comments I like my one better than the model code on this one. Maybe not quite as clear but better.

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

This programs create the method least, which returns the least of the numbers given as parameters. If the parameters are equal, you can decide which one is returned. My Code Model Code Comments Same problem as last time. I created a new variable and then got return to pass it instead of just using return …

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

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

In this program you are asked to implement the method by summing the numbers passed to it and then return them to the main program. My Code Model Code Comments I got all cocky and thought I had it perfect but the model solution halves the lines of code (1 instead of 2) by returning …

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