Answer: question 1: 20 question 2: 21 question 3: 17, 19, 23
Step-by-step explanation:
Given: 11-pound mixture of peanuts, almonds, and raisins
Cost:
peanuts - 1.5 per pound
almonds - 3 per pound
raisins - 1.5 per pound
mixture:
twice as many peanuts as almond; total cost of mixture is 21.
a + p + r = 11 lbs
a + 2a + r = 11 lbs
3a + r = 11
r = 11 - 3a
1.5(2a) + 3a + 1.5r = 21
3a + 3a + 1.5r = 21
6a + 1.5r = 21
6a + 1.5(11-3a) = 21
6a + 16.5 - 4.5a = 21
6a - 4.5a = 21 - 16.5
1.5a = 4.5
1.5a/1.5 = 4.5/1.5
a = 3
almonds = 3 lbs
peanuts = 2a = 2(3) = 6lbs
raisins = 11 - 3a = 11 - 3(3) = 11 - 9 = 2 lbs
<span>My answer is: C. 6 lbs peanuts, 3 lbs almonds, 2 lbs raisins </span>
Answer:
Step-by-step explanation:
32
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;
}
Answer:
a = 0 or a = -7
Step-by-step explanation:
We are going to solve this quadratic equation by factorizing.
a² - 7a = 0
a(a - 7) = 0
a = 0 or a - 7 = 0
a = 0 or a = -7