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
△ABC ≅ △DEF, EF = x 2 - 7, and BC = 4x - 2.
Artist 52 [7]

Answer:

Therefore the value of x is 5.

Step-by-step explanation:

Given:

△ABC ≅ △DEF,

EF = x 2 - 7, and

BC = 4x - 2.

To Find:

the values of x. = ?

Solution:

△ABC ≅ △DEF      ........Given

If two Triangles are congruent then the Corresponding Parts of Congruent Triangles are Congruent.

∴ BC ≅ EF   ...................CPCTC

Substituting the values we get

4x-2=x^{2}-7\\x^{2}-4x-5=0

Now By Factorizing we get

x^{2}-5x+x-5=0\\x(x-5)+1(x-5)=0\\(x+1)(x-5)=0\\x+1=0\ or\ x-5=0\\x=-1\ or\ x=5\\x\ cannot\ be\ negative\\\therefore x=5

Therefore the value of x is 5.

8 0
4 years ago
How many eighths are there in six and three quarters
Alex787 [66]
That questions has to do with equivalent fractions, express a fraction in eights.
six and three quarters
= 6 3/4
<span>= 6 + 3/4
</span>= 24/4 + 3/4
= 27/4
and to convert that fraction to eights, just multiply numerator and denominator by 2:
= (27*2)/(4*2)
= 54/8
there are 54 eights in six and three quarters
3 0
3 years ago
Use the ruler to measure the length of the colored pencils, then select the line plot that best represents this data set.
Marta_Voda [28]
Its the last line plot

4 0
3 years ago
Read 2 more answers
If Y is the midpoint of AB, find B given A(3,5) and Y(-2, 3).*
Murljashka [212]

Answer: (-7,1)

Step-by-step explanation:

6 0
3 years ago
The elevator in the Empire State Building can pass 80 floors in 45 seconds. How many floors can it pass in 9 seconds?
castortr0y [4]
\bf \begin{array}{ccll}&#10;floors&seconds\\&#10;\text{\textemdash\textemdash\textemdash}&\text{\textemdash\textemdash\textemdash}\\&#10;80&45\\&#10;f&9&#10;\end{array}\implies \cfrac{80}{f}=\cfrac{45}{9}\implies \cfrac{80\cdot 9}{45}=f
7 0
3 years ago
Other questions:
  • What set of reflections would carry triangle ABC onto itslelf?
    10·1 answer
  • Y+7= -2/5(x-10). What is the standard form
    11·1 answer
  • QUICK HELP PLEASE!!!!!!
    13·1 answer
  • Helena has taken out a $9,300 unsubsidized Stafford loan to pay for her college education. She plans to graduate in four years.
    11·2 answers
  • Write an algebraic expression to represent the English sentence.
    8·1 answer
  • 95 out of 1200 randomly selected people surveyed in the u.s said they would rather watch baseball on television than go to a gam
    15·1 answer
  • For the 1,000-meter running event, Abby's mean time is 4.5 minutes with a standard deviation of 0.75 minutes. For the 800-meter
    6·2 answers
  • Write each power of ten in standard notation. 10‐³​
    12·1 answer
  • 1) A jewelry store bought 8 beautiful diamond necklaces. Each necklace cost $9,000. How
    8·2 answers
  • PLEASE HELP find the arch shown in red leave your answer in terms of pi
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!