235k views
4 votes
If you were to write a program that would take the name of a state in the United States as theinput and give you the name of its capital as the output, would it be a function? Why or whynot?(2 Points)

User Sharl
by
3.3k points

1 Answer

2 votes

If we have that a function is a relation between two variables such as the independent variable, x, has exactly one independent variable, y, then, we can say that the function in the program is a function.

Each state has only one capital. It is not the case, that, for example, one state has two capitals, in which case the relation is not a function.

Therefore, if we have a program that would take the name of a state as an input, and as an output the name of its capital, it would be a function.

User Pseudonymous
by
3.5k points