- A function is a calculation that gives an output when an input is given.
a) 4
b) 17
c) 0
- F(x) = x/4 - 5
a) 4
b) 17
c) 0
A function is a block of code that performs a task. It can return a value or not. It is called in blockchain as smart contracts. When it returns a value the coder decides the type. That can be a string, a character, an integer or a number.
f(x) = {
x^2 if x is even
x+10 if x is odd
}
What will be the output for the following inputs?
f(x) (x/4)-5
Describe what a function does in your own words
A function is a program where an user gives and input to get a result (output) obtained through the language written inside the function
Calculate the output of the following function
f(x) = {
x^2 if x is even
x+10 if x is odd
}
What will be the output for the following inputs?
a) f(2) 2 is even f(x)= x^2 f(2)= 2^2=4
b) f(7) 7 is odd f(x)=x+10 f(7)=7+10=17
c) f(0) 0 is even f(x)= x^2 f(0)= 0^2=0
Write the definition of a function f that takes an input x, divides it by four and then outputs that result subtracted by 5.
f(x)= x/4-5
A function is a method of taking and input and it comes up with an output
2.) 4
b.) 17
c.) 0
3.) f(x)=x/4-5
f(x) = {
x^2 if x is even
x+10 if x is odd
}
What will be the output for the following inputs?
0 is an even number so the result is defined
A function is a mathematical calculation which involves an input that produces a logical output as a result of the function’s computation.
a.
When x = 2, the function will be f(x) = {
x^2
}
making the answer 4
b.
When x = 7, the function will be f(x) = {
x+10
}
making the answer 17
c.
When x = 0, the function will be f(x) = {
x^2
}
making the answer 0 (or maybe there will be some sort of error saying tht 0 is an undefined input or something idk
)
f(x) = {
(x/4)-5
}
Homework on Functions - Questions
A function is a computation that produces an output based on the input, where x is a variable
f(x) = {
x^2 if x is even
x+10 if x is odd
}
What will be the output for the following inputs?
f(x) = (x/4)-5
Describe what a function does in your own words
-A function is the formula for an automated action.
Calculate the output of the following function
f(x) = {
x^2 if x is even
x+10 if x is odd
}
What will be the output for the following inputs?
a) f(2) = 4
b) f(7) = 14
c) f(0) = 0
A function is a computation that defines a relation between input and output. So it defines what the general output is of an input given.
a) 4
b) 17
c) 0
f(x) = x/4 - 5
The second function output is not correct, if you don’t know why, hmu!
A function is a mathematical operation, which processes any given input according to a predefined computation
a = 4
b = 17
c=0
a function is a mathematical way to solve for a variable
x=4
=14
=0
f(x) = (x/4)-5
[quote=“ivan, post:1, topic:8429”]
f(x) = {
x^2 if x is even
x+10 if x is odd
}
What will be the output for the following inputs?
Thank you for pointing this out! I didn’t catch this mistake. Definitely an oversight. I don’t see a way for me to edit this response though.
1- A function is a computation with variable data starting with an input and resulting to an output.
2- a) 4
b) 17
c) 0
3- f(x) = x/4 - 5
A function is a mathematical function that has an input and gives an output.
a.) 4
b.) 17
c.) 0
3.f (x) = (x/4) - 5