P5.js code for creating a calculator tip app confused

could u show me an example on how it would work and look like im still a bit confused