task 10, Classes part 2, Alternative

using interfaces