A function should convert a Fahrenheit temperature (F) to a Celsius temperature. What should be the output from the function?
Correct Answer: A
Comprehensive and Detailed Explanation From Exact Extract:
A function that converts a Fahrenheit temperature (F) to Celsius (C) should output the Celsius value, as the purpose is to perform the conversion. The formula is C = (F - 32) * 5 / 9. According to foundational programming principles, a function's output should be the computed result of its task.
* Option A: "C only." This is correct. The function's purpose is to convert F to C, so it should return the Celsius temperature (e.g., in Python: def f_to_c(f): return (f - 32) * 5 / 9).
* Option B: "F only." This is incorrect. Returning the input (Fahrenheit) does not accomplish the conversion.
* Option C: "F and C." This is incorrect. While the function could return both, the question asks for the output of the conversion, which is C. Returning F is redundant.
* Option D: "F and 32." This is incorrect. The constant 32 is part of the formula but not a meaningful output, and F is the input, not the result.
Certiport Scripting and Programming Foundations Study Guide (Section on Functions and Return Values).
Python Documentation: "Functions" (https://docs.python.org/3/reference/compound_stmts.html#function- definitions).
W3Schools: "C Functions" (https://www.w3schools.com/c/c_functions.php).