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]
2 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]2 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
Without drawing the graphs, find the points of intersection of the lines:
tankabanditka [31]
The answer is (4,7) :)
4 0
3 years ago
the sum of three numbers is 81. the second number is twice the first, and the third number is six more than the second. find the
ElenaW [278]

Answer:

have you tried using math-way just with no -

Step-by-step explanation:

3 0
2 years ago
Solve for x in the function
Zinaida [17]

Answer:

4

Step-by-step explanation:

<h3>2^3= 2x2x2= 8 + 4 =12</h3><h3 /><h3>but it is 16 not 12 so 16 - 12 =4 so that should be ur awnser.</h3><h3 /><h3 /><h3 /><h3>In return can u answer the question that i just asked on my account</h3>
3 0
3 years ago
Help me please !!!!!!!!!!!!!!
tensa zangetsu [6.8K]

Answer:

\large\boxed{V=\dfrac{49\pi}{3}\ in^3}\approx51.29\ in^3}

Step-by-step explanation:

The formula of a volume of a cone:

V=\dfrac{1}{3}\pi r^2H

r - radius

H - height

We have

r = (7 : 2) in = 3.5 in

H = 4 in

Substitute:

V=\dfrac{1}{3}\pi(3.5)^2(4)=\dfrac{1}{3}\pi(12.25)(4)=\dfrac{49\pi}{3}\ in^3

\pi\approx3.14\\\\V\approx\dfrac{(49)(3.14)}{3}\approx51.29\ in^3

5 0
3 years ago
A circle has a radius of 20 centimeters and a central angle that measures 216 degrees. What is the length of the arc defined by
Bumek [7]

Answer:4320cm

Step-by-step explanation:

(length of the arc)/(length of the radius)=central angle

lengthof the arc/20=216

lengthof the arc=216×20

length of the arc=4320cm

8 0
2 years ago
Other questions:
  • Twice a number decreased by 16 is 64.
    12·1 answer
  • This is 15 points !!!!!!!
    11·2 answers
  • The cost of 60 shares of fly by night airlines is $67.50. How many shares can you buy with $675.00?
    7·1 answer
  • I need help with this STAAR practice
    14·2 answers
  • In a study of pain relievers , 100 people were given product A , and all but 33 experienced relief . In the same study , 50 peop
    13·1 answer
  • PLEASE HELP!! can you solve this problem? you need to fill all 10 squares with the correct number and/or symbols. Below are the
    11·1 answer
  • Which expression is equal to 20.92 ÷ 6.8?
    13·1 answer
  • Brian invests £1500 into his bank account. He receives 2% per year simple interest. How much will Brian have after 3 years? Give
    13·1 answer
  • Find the code word by completing the maze below. To complete the maze you must determine what type of triangle is formed by the
    11·1 answer
  • Can you help me with this
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!