Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question 6 of 10 this modules ____ uses conditionals to return differen…

Question

question 6 of 10
this modules ____ uses conditionals to return different values.
function getplayerchoice
set choice to ask for number \1=rock 2=paper 3=scissors\
if choice = 1 then
return
ock\
else if choice = 2 then
return \paper\
else
return \scissors\
a. function call

Explanation:

Brief Explanations

In programming, a function is a block of code that performs a specific task. Here, the getPlayerChoice is a function. It uses conditional statements (if, else if, else) to return different values ("Rock", "Paper", "Scissors") based on the input number. A function call would be when we use the function (e.g., getPlayerChoice()), but the code structure shown is the function definition with conditionals. Control structure refers more to the flow - control mechanisms like loops and conditionals in general, but the key here is that it's a function using conditionals.

Answer:

The blank should be filled with "function".