Implementation of calculator components covered in lecture 2