-
A function is an mathematical calculation using a variable/input to produce an output
-
A) = 4
B) = 17
C) = 0 -
f(x)= (x/4)-5
- A method to compute an input to provide an output
- a. f(2) = 4
b. f(7) = 17
c. f(0) = 0 - f(x) = (x/4)-5
a) 4
b) 17
c) 0
3- f(x) = (x/4) - 5
- Describe what a function does in your own words
Functions are mathematical computations. - 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) = 17
• c) f(0) = 0
3. 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
Functions:
-
Describe what a function does in your own words
A function is like a black box which takes something as input and returns something as output. -
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) = 17
- c) f(0) = 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 describes rules for a given input
a, 4
b, 17
c. f(x) = x/4-5
-
A function defines what calculation applies to its input values.
-
a) 4
b) 17
c) 0 -
f(x) = (x : 4) - 5
-
A function performs a specific math calculation, to calculate a certain value. A function is reusable.
-
a) = 4
b) = 17
c) 0 -
f(x) = {
x / 4 - 5
}
- A function takes some input, performs some computations and returns an output
- a ) 4 b) 17 c) 0
- f(x) = (x/4-5)
A function is a computation, is applies a rule(s) to a given value.
a) 4
b) 17
c) 0
f(x) = {(x/4) - 5}
a function is a calculation that produces a result from a given set of parameters.
a) 4
b) 17
c)0
- f(x) = (x / 4) -5
- A set of instructions on how to solve the problem to obtain the output for the function.
2a. 4
2b. 17
2c. 0
3. f(x) = x/4-5
-
Describe what a function does in your own words
A function is a computation that determine what an output is based on the input calculation rules -
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) 17
- c) f(0) 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
Homework - functions
Describe what a function does in your own words
A function is a computational task.
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) 70
c) f(0) 1
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
1/A function is instructions used to create an output from its input. Functions are code that take in data, process it and give an output result and once written can be used over and over
2/a-4
b-17
c-0
3/ f(x)=(4)-5
is it a typo error? f(7) = 7 + 10 = 17.
Zero is even number. f(0) = 0^2 = 0.
I’m sorry, I typically misread this x and + in each others place… so x10 instead of +10 sorry for that.
-
Describe what a function does in your own words
A function takes an input and does some calculation, generating an output. -
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)
=> 17 - c) f(0)
=> 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 (int x) {
print( x/4 - 5);
}
1.it gives the rules of how to find the output from the input.
2.4
17
0
3. f(x)=(x/4)-5