Homework on Functions - Questions

1, A function is a variable input used to calculate or define an output.

2, a. 4
b. 17
c. 0

3, f(x) = (x/4)-5

1 Like
  1. A function accepts an input, processes it, then gives an output
  2. a. f(2) = 2^2 = 4
    b. f(7) = 7 + 10 = 17
    c. f(0) = null
  3. f(x) = (x/4) - 5
1 Like
  1. if the value of x is even then x will be equal to the value of x squared and if the value of x is odd then x will be equal to the value of x plus 10.

a) 4
b)17
c)0

  1. f(x) = { (x / 4) - 5 }
1 Like

Understood. Thank you!

1 Like
  1. A function performs a task or a calculation and provides a result depending on the input.
    2.a)4 b)17 c)0
  2. public static int f(int x)
    {
    int y;
    y= (x*4)-5;
    return y;
    }
1 Like
  1. A function is a set of rules that are carried out on an input to produce an output.

a) f(2) 4
b) f(7) 17
c) f(0) 0

  1. f(x)=(x/4)-5
1 Like

I wonder , when I se that function especialy the even and odd parts.
Shouldnt the seven be 7+10= 17 ??? Since it is an odd number. So the answers would be

a=4
b=17
c=0

???

1 Like

A function does the same action to each of the unique variables entered.

4
17
0

f(x)=(x/4)-5

1 Like
  1. It takes an input and produces a unique output.
    2a 4
    2b 17
    2c 0
    3.f(x) = x/4 -5
1 Like

yes, if x is odd, you need to add 10.
If x is even, you need to multiply it by itself.

1 Like

Homework on Functions - Questions

  1. Describe what a function does in your own words It is an input that generates an output.
  2. 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
  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 Like
  1. A function receives an input, does some calculation or processing, and returns an output.
  2. a. 4
    b. 17
    c. 0
  3. f(x) = (x/4)-5
1 Like
  • Describe what a function does in your own words
    A Function is a mathematical calculation. Relating to a smart contract, a Function is a specific predetermined calculation to be carried out onto each Input.

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

1 Like

1 - A function creates an output determined by the input parameters

2 -

A=4

B= 17

C= 0

3 - f(x) = (x/4) - 5 (although based on the instruction video it isn’t clear to me what symbol is used to divide a number)

1 Like

A functions is a sequence of computation; have some inputs and you expect some output.
a) 4
b) 17
c) 0

f(x)= (x/4) - 5

1 Like
  1. Describe what a function does in your own words
    With any input entry, a function delivers an output based on predefined formulas.

  2. 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
  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 Like
  1. Describe what a function does: It relates an input to an output.
  2. 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
  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 Like

A function describes and calculates values

a)4
b)17
c)0

f(x)=(x:4)-5

1 Like

1, A function relates an input to an output
2, a(4) b(17 c(0)
3, f(x)= x/4-5

1 Like
  1. Function takes a value(s) as input and calculates the output based on the function definition.

a) 4
b) 17
c) 0

f(x) = {x/4 - 5}
1 Like