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
azamat
3 years ago
10

Define the function add_mn that takes two integers m, n as arguments and returns m + 10 * n. For instance, add_mn 3 5 = 3 + 10*5

= 53. You are, however, not allowed to use addition and multiplication directly: instead, you must write a recursive solution that calls add10!
Mathematics
1 answer:
jok3333 [9.3K]3 years ago
8 0

Answer:

// C++ Program to arithmetic operationf on 2 Numbers using Recursion

// Comments are used for explanatory purpose

#include <bits/stdc++.h>

using namespace std;

// add10 recursive function to perform arithmetic operations

int add10(int m, int n)

{

return (m + product(n, 10)); //Result of m + n * 10

return 0;

}

// Main Methods Starts here

int main()

{

int m, n; // 2 Variables m and n declared as integer

cin>>m; // accept input for m

cin>>n; // accept input for n

cout << "Result : "<<add10(m,n); // Print results which is calculated by m + 10 * n

return 0;

}

You might be interested in
A bike shop rents bikes for $4.50 per hour, plus a $7.50 insurance charge. For how many hours can Peter rent a bike if he has $3
Mandarinka [93]

Answer:

With $30, Peter can afford 5 hours

Step-by-step explanation:

Given

Insurance Charge = $7.5

Charges = $4.5 per hour

Required

Determine the number of hours $30 can afford

First, we need to determine the equation.

<em>Total Charges = Charges per hour + Insurance Charge</em>

Substitute values for Charges per hour and Insurance Charge

Total Charges = 4.5 per hour + 7.5

Let the number of hours be n;

So,

Total Charges = 4.5n + 7.5

To calculate Peter's; substitute 30 for total charges

30 = 4.5n + 7.5

Subtract 7.5 from both sides

4.5n = 30 - 7.5

4.5n = 22.5

Divide both sides by 4.5

n = \frac{22.5}{4.5}

n = 5

Hence;

<em>With $30, Peter can afford 5 hours</em>

3 0
3 years ago
Amir has $200 budget to spend on a graduation party for his son he already has purchased $122 worth of drinks and party supplies
Bas_tet [7]

Answer: C, D, and E

Step-by-step explanation:

200-122=78 remaining

A: 7*11.75= 82.25

B: 10*11.75= 117.50

C: 9*6.80=61.20

D: 11*6.80=74.80

E: 70*1.10=77.00

F: 71*1.10=78.10

Only C, D and E are below the dollars remaining in the budget.

5 0
3 years ago
Which expression is equivalent to (4^−3)^−6?<br><br>1. 4^-18<br>2. 4^18<br>3. 4^-9<br>4. 4^3
malfutka [58]

Answer:

4^18

Step-by-step explanation:

4^18 = 2^36

(4^−3)^−6? = 2^36

Please visit: https://youtu.be/_0Ft9HdNg5c

Thanks.

8 0
3 years ago
Can you please help me <br> Step by step as well for brainliest
romanna [79]

Answer:

Step-by-step explanation:

42:7=ED:24

cross multiply 42 into 24.

Then divide by 7

you will get ED

Then use pythageorous theorem.

Ed square + 42 square=Ef square

Then do square root of Ef square

7 0
3 years ago
The historical walking tour of a town covers a total distance of 5 miles. The map shows that the path of the tour travels 3 inch
kari74 [83]
Since the problem is given all the total walking distance, the first thing we are going to do is find the total distance in the map:
Diastance_{map}=3+4+2+1
Distance_{map}=10
Now that we have the distance in the map, we can establish a ratio between the walking distance and the distance in the map:
\frac{5miles}{10inches} = 0.5 \frac{mile}{inch}

We can conclude that each inch the map represents 0.5 miles of walking distance. 

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the solution of the equation? <br> please help!!
    14·1 answer
  • Using an ordered alphabet of 26 letters, how many ways are there to choose a set of six letters such that no two letters in the
    11·1 answer
  • The following 5 questions are based on this information: An economist claims that average weekly food expenditure of households
    9·1 answer
  • Hank is throwing a surprise party. The party costs $20 per person. Create an equation and graph to represent the relationship be
    12·1 answer
  • A pair of sneakers costs $46. You have a coupon for 15% off the purchase. What is the sale price of the sneakers?
    13·2 answers
  • Answer fast please
    11·1 answer
  • Please help!!!
    13·1 answer
  • Factor the expression using the GCF.<br><br> 26x - 13
    10·2 answers
  • Write an equation that represents the line. (-3,-6) and (2,-2) use exact numbers
    5·1 answer
  • What is the area of the polygon given below?<br> 14<br> 7<br> 14<br> 27
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!