How to use add fraction in the code

ive been tasked to make a simple calculator by my teacher but i cant figure out on how to add fractions in the blocks can anyone tell me?

hello,

show your blocks of what you have done so far and explain your problem in detail.