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
likoan [24]
3 years ago
12

Using recursion, write a program that asks a user to enter the starting coordinates (row, then column), the ending coordinates (

row then column), and calculates the number of paths from the starting coordinate to the ending coordinate.
Computers and Technology
1 answer:
Luden [163]3 years ago
4 0

Answer:

The program in Python is as follows

def Paths(row,col):

if row ==0 or col==0:

 return 1

return (Paths(row-1, col) + Paths(row, col-1))

row = int(input("Row: "))

col = int(input("Column: "))

print("Paths: ", Paths(row,col))

Explanation:

This defines the function

def Paths(row,col):

If row or column is 0, the function returns 1

<em> if row ==0 or col==0: </em>

<em>  return 1 </em>

This calls the function recursively, as long as row and col are greater than 1

<em> return (Paths(row-1, col) + Paths(row, col-1))</em>

The main begins here

This prompts the user for rows

row = int(input("Row: "))

This prompts the user for columns

col = int(input("Column: "))

This calls the Paths function and prints the number of paths

print("Paths: ", Paths(row,col))

You might be interested in
__________ is a computer tool for evaluating the risk of exposure to wildfires.
Brut [27]

Answer:

The statement is true

Explanation:

5 0
2 years ago
Read 2 more answers
Which software development team member would make the most use of the tool, Load Runner?
sveta [45]
Given that Loadrunner is a software testing tool, I'm assuming that the software development team member who would make the most use of that tool is A. a software engineer, because that is the person who creates software and then tests it. 
4 0
3 years ago
PLEASE HELP 15 POINTS; JAVASCRIPT
sdas [7]

Answer:

D

Explanation:

4 0
3 years ago
Write six causes of data lost
just olya [345]
<span>1. Deleting files accidentally
</span>

2. Viruses and damaging malware

3. Mechanical damages of hard drive

4. Power failures

5. Theft of computer

6. Spilling coffee, and other water damages

7. Fire accidents and explosions

<span>Hope this helps.</span>
3 0
4 years ago
Which tools can be used to scale an object? Check all that apply.
meriva

Answer:

format picture pane

corner sizing handles

Explanation:

7 0
3 years ago
Other questions:
  • A circuit has a resistance of 300 ohm and a current of 0.024 A. What is the voltage in the circuit?
    12·1 answer
  • Study the sentence below. Highlighting a word, phrase, or a sentence is used to emphasize or CALL ATTENTION to the text Which wo
    10·1 answer
  • The point on the middle of an edge in SketchUp is called a...
    5·2 answers
  • Which Excel tool adjusts the values in multiple input cells to either maximize, minimize, or reach a specific output value given
    11·1 answer
  • Compare GBN, SR, and TCP (no delayed ACK). Assume that the timeout values for all three protocols are sufficiently long such tha
    11·1 answer
  • Zahra's softball team needs money for team T-shirts. The coach makes some fundraising suggestions, while team members brainstorm
    5·2 answers
  • Which of the following is NOT an example of soft skill?
    10·2 answers
  • Using only AND, OR and inverter gates to implement the above Boolean equation, how many gates are needed
    8·1 answer
  • if you put a drone on the charger at 8:12 and take a break at 10:03 how long is it on the charger. for
    7·1 answer
  • What is the difference between encoding and decoding?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!