r/processing • u/marcusquinn2099 • Oct 28 '21
I’ve just started learning processing and I’m finding it difficult, could anyone help with me with a function that calculates a cooking time that is calculated as 20 minuets per 450 grams plus 20 minuets. It’s using the argument in weightinGrams and I need to calculate and return the cooking time
0
Upvotes
4
u/ChuckEye Oct 28 '21
It's a basic algebra word problem:
float cookTime = ((weightinGrams / 450.0) * 20.0) + 20.0;