+ 1
Im trying to solve an average of two numbers, and I cant quite figure out how. Am i overthinking this?
(I just started coding so understand that this is kinda confusing for me) function solveMyAverage(x, y) { x + y = z return z / 2 = q document.write(q) } solveMyAverage(28.56, 39.85)
4 Respostas
+ 12
function solveMyAverage(x, y) {
return (x+y)/2;
}
document.write(solveMyAverage(28.56, 39.85));
+ 6
in here
x = 28.56
y = 39.85
so 28.56 + 39.85 = z (please add by yourself^^)
and the result is z and z dived by two 😎 and the result of the z / 2 is q .
understand ??
0
Thanks both of you. That makes more sense now