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
A system of equations is shown. 3x+4y=30 3x+5y=33. What is the value of y in the solution to the system of equations
Yuliya22 [10]

Answer: y Is equal to 3 And x Is equal to 6

4 0
3 years ago
Read 2 more answers
Factor completely 4x^5-20x^3
nikdorinn [45]

Answer:

<em>4x^3(x^2 - 5)</em>

Step-by-step explanation:

First, try to factor a common factor.

GCF of 4 and -20 is 4.

GCF of x^5 and x^3 is x^3.

Factor out 4x^3.

4x^5 - 20x^3 =

= 4x^3(x^2 - 5)

3 0
3 years ago
A new school banner is to be 4 1/2 feet wide by 7 1/4 feet long. what is the area? if a fabric for the banner costs $6 a square
lilavasa [31]

The area is 32 5/8 ft squared and It would cost$ 195.75


how to slove: you take the to fractions and mulitply them and get 32 5/8 for the area then you multiply 32 5/8 by 6 to find the price of the banner.

3 0
3 years ago
How many tenths are in 13.58
Naily [24]
Tenths is after the decimal so the tenths is 5.
3 0
3 years ago
Anyone know the answer ???
mafiozo [28]
Hello!

Since the angles are same side alternate angles they are equal to each other

60 - 2x = 70 - 4x

We solve this algebraically

Add 4x to both sides

60 + 2x = 70

Subtract 60 from both sides

2x = 10

divide both sides by 2

x = 5

Hope this helps!
6 0
4 years ago
Other questions:
  • which expression can be used to check the answer to 56 divide (-14)=n? A.-14 multiply by n B. n divide (-14) C. 56 multiply by (
    9·2 answers
  • What is the answer for a magic square for the number 18?
    7·2 answers
  • Often, there is more than one set of sequences that will take a preimage to an image. Determine one or two other sequences to cr
    12·1 answer
  • Five friends attend a matinee movie and spend $8 per ticket. They also purchase a small bag of popcorn each. If the friends spen
    6·2 answers
  • If an arithmetic sequence
    13·1 answer
  • 2x-6у =4 help I don’t know
    6·1 answer
  • Select the correct answer.
    5·1 answer
  • PLEASE HELP! WILL GIVE BRAINLIEST! After substituting, what is the first step when evaluating 4y+9 when y=82 O Add 4 and 9. O Mu
    13·1 answer
  • Value of [(3/2)^(-2)] is *​
    8·1 answer
  • Thomas went to the toy store. He bought ​yo-yos for ​$ each including tax. How much money did Thomas spend on the​ yo-yos?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!