A program needs to choose apples, oranges, or bananas based on an input. Which of the following programming constructs is BEST to use?
A program needs to choose apples, oranges, or bananas based on an input. Which of the following programming constructs is BEST to use?
The best programming construct to use for choosing between options like apples, oranges, or bananas based on an input is a conditional statement, such as 'if'. Conditional statements (if statements) allow the program to execute different blocks of code depending on the input, making it the most appropriate choice for this scenario.
constructs are things like If, Then, Else type of statements. So the answer is B.
B.If is the answer.
IF is the Answer.