Logic Code for Calculator App