asked 27.2k views
0 votes
Which of the following would be a good name for the function that takes the

length of a race and returns the time needed to complete it?
A. Time(race)
OB. Time(length)
C. Cost(time)
D. Length(time)

asked
User Prakhyat
by
8.0k points

1 Answer

7 votes

Final answer:

The function that takes the length of a race and returns the time needed to complete it should be named Time(length).


Step-by-step explanation:

The function that takes the length of a race and returns the time needed to complete it could be named Time(length). This is because the function is being given the length of the race as input and the time needed to complete it is the output. The name Time(race) would imply that the function takes a race as input, which is not the case. Therefore, Option B is the correct choice.


Learn more about naming a function that calculates time for completing a race

answered
User Ludo Schmidt
by
9.2k points

No related questions found

Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.