Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question 8 of 22 which of the following would be a good name for the fu…

Question

question 8 of 22
which of the following would be a good name for the function that takes the weight of a box and returns the energy needed to lift it?

a. box(cost)

b. energy(weight)

c. weight(box)

d. weight(energy)

Explanation:

Brief Explanations

The function takes the weight of a box (input: weight) and returns the energy needed to lift it (output: energy). Option B, Energy(weight), correctly represents this relationship as the function name (Energy) corresponds to the output and the parameter (weight) corresponds to the input. Option A refers to cost which is irrelevant, Option C focuses on weight as output (not energy), and Option D reverses the input - output relationship.

Answer:

B. Energy(weight)