Homework on Functions - Questions

  1. A function is a calculation that gives an output when an input is given.

a) 4
b) 17
c) 0

  1. F(x) = x/4 - 5
1 Like
  1. Describe what a function does in your own words

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.

  1. 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

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

1 Like

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

1 Like
  1. Functions are described as a mathematical formula that give an output based off the input.
  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) Answer: a) 4
  • b) f(7) Answer: b) 17
  • c) f(0) Answer: c) 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

0 is an even number so the result is defined :wink:

  1. A function is a mathematical computation of an input that gives a logical output based on the computation of the function.
    2.a) f(2) = 4
    2.b) f(7) = 17
    2.c) f(0) = 0
  2. f(x) = (x/4) - 5
1 Like

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
}
:arrow_right: making the answer 4

b.
When x = 7, the function will be f(x) = {
x+10
}
:arrow_right: making the answer 17

c.
When x = 0, the function will be f(x) = {
x^2
}
:arrow_right: making the answer 0 (or maybe there will be some sort of error saying tht 0 is an undefined input or something idk :sweat_smile:)

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

1 Like

Homework on Functions - Questions

  1. Describe what a function does in your own words

A function is a computation that produces an output based on the input, where x is a variable

  1. 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 in your own words
    -A function is the formula for an automated action.

  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)
  • b) f(7)
  • c) f(0)

a) f(2) = 4
b) f(7) = 14
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. They make calculations based on the formula, then the result is executed.
  • a) f(2) f=4
  • b) f(7) f=17
  • c) f(0) f=0
  1. f(x)={(x/4)-5}
1 Like
  1. 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.

  2. a) 4
    b) 17
    c) 0

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

1 Like

The second function output is not correct, if you don’t know why, hmu!

1 Like
  1. A function is a mathematical operation, which processes any given input according to a predefined computation

a = 4
b = 17
c=0

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

a function is a mathematical way to solve for a variable
x=4
=14
=0
f(x) = (x/4)-5

1 Like

[quote=“ivan, post:1, topic:8429”]

  1. Describe what a function does in your own words - a function is a piece of logic that transforms input into 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

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 Like

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

1 Like
  1. A function is a mathematical function that has an input and gives an output.

  2. a.) 4
    b.) 17
    c.) 0

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

1 Like
  1. A function computes an output based on an input according to the definition of the function.
  2. What will be the output for the following inputs?
    a) f(2) = 4
    b) f(7) = 17
    c) f(0) = 0
  3. f(x) = x/4-5
1 Like