We need to call for x minute
+ Phone Company A charges a monthly fee of $42.50, and $0.02 for each minute talk time. So we have to spend: <span>$42.50+ $0.02x
+ </span>Phone company B charges a monthly fee of $25.00, and $0.09 for each minute of talk time. So we have to spend: <span>$25.00+ $0.09x
We solve for x: </span>$42.50+ $0.02x> <span>$25.00+ $0.09x
or </span>$42.50- $25.00 > $0.09x- <span>$0.02x
and we have $0.07x<$27.50
or x< 27.50:0.07 and x< 393.86
The answer is:
If we have to call much time, at least 394 minutes, we should choose A
If not, choose B</span>
It is rounded to the nearest tens. You can only round when you have 1,9. Hope I helped
I believe it is 56 because 7•8 is 56 and 1•56 is 56
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;
}