52.2k views
0 votes
A function takes an input of a whole number and if the number is less than 10, multiplies it by 5. If the input number is greater than or equal to 10, subtracts 5 from the input. If I input the numbers 8 and 14 into the function, what outputs should I expect to return?

User Miguelao
by
5.1k points

1 Answer

7 votes

Answer:

When you input 8, the output will be 40

When you input 14, the output will be 9

Explanation:

let the function = fn

If fn < 10, then output = 5(fn)

If fn ≥ 10, then, Output = fn - 5

When you input 8 ( 8 is less than 10, then multiply by 5)

fn = 8 and 8 < 10

Output = 5(fn)

Output = 5 x 8

Output = 40

When you input 14 ( 14 is greater than 10, then subtract 5 from the input)

Output = fn - 5

Output = 14 - 5

Output = 9

User Logo
by
5.9k points