I will be using the language C++. Given the problem specification, there are an large variety of solving the problem, ranging from simple addition, to more complicated bit testing and selection. But since the problem isn't exactly high performance or practical, I'll use simple addition. For a recursive function, you need to create a condition that will prevent further recursion, I'll use the condition of multiplying by 0. Also, you need to define what your recursion is.
To wit, consider the following math expression
f(m,k) = 0 if m = 0, otherwise f(m-1,k) + k
If you calculate f(0,k), you'll get 0 which is exactly what 0 * k is.
If you calculate f(1,k), you'll get 0 + k, which is exactly what 1 * k is.
So here's the function
int product(int m, int k)
{
if (m == 0) return 0;
return product(m-1,k) + k;
}
He has 11 quarters, 9 dimes, and 55 nickels.
11x.25=2.75
9x.1=.9
55x.05=2.75
2.75+2.75+.9=6.4
Addy’s monthly water bills for last year are $27, $31, $30, $26, $25, $27, $37, $33, $32, $28, $26, $26. Express the formula for
Sav [38]
Answer:
Σ( xi ) / n ; $29
Step-by-step explanation:
Given the following data:
X= $27, $31, $30, $26, $25, $27, $37, $33, $32, $28, $26, $26
Number of observations (n) = 12
Mean formula (m) = ( Σ xi ) / n
Where i = each individual value in X
Mean water bill for the years is thus :
m = Σ [(27 + 31 + 30 + 26 + 25 + 27 + 37 + 33 + 32 + 28 + 26 + 26)] / 12
m = 348 / 12
m = 29
Hence, the mean water bill for the year is $29
Answer:
8x-3y=3
Step-by-step explanation:
Its the only one that would give you a negative x
2x+17 4x-1 6x+9 17+9-1=25
Single out the x and add 2,4,and six and you get
12x+25