ABS chapter 4

Ready for review.
It's intentionally different because the first one was handling user input whereas this exercise doesn't require us to handle user input so I removed those parts of the function.