Interface added for input output.
Test for problem 1 using mock class.