A tip calculator is a classic beginner project, which is exactly why it is a good lens for the small decisions that separate a toy from a tool people actually use at a restaurant table.
Start with the presets. In the UK the useful rates are 10 percent (standard), 12.5 percent (the London service charge norm) and 15 percent (generous). Hardcoding those three covers nearly every real case, and they map neatly onto mental maths: a tenth, an eighth, and ten plus five. If you are curious about the human side, the 10 second methods for 10, 12.5 and 15 percent show how people do the same calculations without any code at all.
Rounding is the first real design decision. Money wants two decimal places, but people pay in clean amounts. Round the tip to the nearest 10p or pound and say so in the UI, or keep exact figures and let the user round. Either is defensible.…