Exercise 46 updated with Math.abs and dedicated println