1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
olga nikolaevna [1]
3 years ago
8

Without using a division or multiplication operator and without using iteration , define a recursive method named product that a

ccepts two int parameter , m and k, and calculates and returns the integer product of m times k . you can count on m>=0 and k>=0.
Mathematics
1 answer:
Fantom [35]3 years ago
8 0

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;  
}
You might be interested in
Please answer correctly !!!!!! Will mark brainliest Answer !!!!!!!!!!!
enyata [817]

Answer:

45 meters

Step-by-step explanation:

graph the equation and find the y-intercept

3 0
3 years ago
Helppp please needed before tomorrow!!!!!!!!!!​
mel-nik [20]

Answer:

The function is 200+50t (t= # of months)

Step-by-step explanation:

The best way to do this is to look at the question, and see no matter what, we have to pay 200 dollars to start. After which, they charge 50 bucks a month. Knowing this, we can make a function using f(x). Let C(t)= cost. Included is that graph. So for these questions, we need to see that there is an independent and a dependent variable, and we need to see that cost is affected by time. Hope this helps.

3 0
2 years ago
You estimate that there are 45 marbles in a jar. The actual amount is 82 marbles. Find the percent error. Round to the nearest t
Nataly_w [17]

Answer:

45.1

Step-by-step explanation:

The original amount is 82

But the wrong amount is 45

So we will have to calculate the percentage for the error

82-45

37

So %error= 37/82 ×100

=3700/82

=45.121~45.1( to nearest tenth)

So the final answer is 45.1%

6 0
3 years ago
A thermodynamic analysis of a proposed brayton cycle gas turbine yields p=5 mw of net power production
lina2011 [118]
The Brayton cycle<span> is a thermodynamic </span>cycle<span> named after George Bailey </span>Brayton<span> that describes the workings of a constant pressure heat engine. The original </span>Brayton<span> engines used a piston compressor and piston expander, but more modern gas turbine engines and air breathing jet engines also follow the </span>Brayton cycle<span>.</span>
4 0
3 years ago
What are the solutions to the quadratic equation (5y +6) 2= 24?
boyakko [2]

Answer:

y=-2.18,-0.22

Step-by-step explanation:

We have been given the equation

(5y+6)^2=24

Take square root both sides. When ever we take square root, we include plus minus sign

\sqrt{(5y+6)^2}=\pm\sqrt{24}\\\\5y+6=\pm2\sqrt6

Now, subtract 6 to both sides of the equation

5y=-6\pm2\sqrt6

Divide both sides by 5

y=\frac{1}{5}(-6\pm2\sqrt6)

y=\frac{1}{5}(-6+2\sqrt6),y=\frac{1}{5}(-6-2\sqrt6)

In decimal we have

y=-2.18,-0.22



3 0
3 years ago
Other questions:
  • How to find the area of 9 inches times 3 inches times 3 inches times 3 inches times 2 inches
    13·2 answers
  • What are the coordinates the vertex for the quadratic function below? f(x)=-5(x-10)^2-8
    15·1 answer
  • Find the constant of variation k for the direct variation. 4x = –6y
    15·2 answers
  • Which attribute is true of one of the shapes but not of both?
    11·1 answer
  • Which is the graph of the system of inequalities y &gt; 4/5 x – 1/5 and y &lt; 2x + 6
    8·2 answers
  • On November 7, 2013, Twitter began to sell shares of its company and Naomi purchased 20 shares for $26 each. It went up $3.15 ev
    8·1 answer
  • Find the values of x and y that make these triangles congruent by the HL theorem
    6·1 answer
  • Please help me I don’t understand this
    7·1 answer
  • Find the slope of the following coordinate<br> points.<br> (4.25, 0) and (3.5, 3)
    15·1 answer
  • What’s the answer to this, help plzzzzz
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!