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]
2 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]2 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
A customer comes into a grocery store and buys 8 items. Write a PYTHON program that prompts the user for the name of the item AN
Dmitrij [34]

Answer:

name = []

price = []

for i in range(0,8):

item_name = input('name of item')

item_price = input('price of item')

name.append(item_name)

price.append(item_price)

for i in range(0, 8):

print(name[i], '_____', price[i])

Explanation:

Python code

Using the snippet Given :

Apples 2.10

Hamburger 3.25

Milk 3.49

Sugar 1.99

Bread 1.76

Deli Turkey 7.99

Pickles 3.42

Butter 2.79

name = []

price = []

#name and price are two empty lists

for i in range(0,8):

#Allows users to enter 8 different item and price choices

item_name = input('name of item')

item_price = input('price of item')

#user inputs the various item names and prices

#appends each input to the empty list

name.append(item_name)

price.append(item_price)

for i in range(0, 8):

print(name[i], '_____', price[i])

# this prints the name and prices of each item from the list.

3 0
2 years ago
During the design phase of the systems development life cycle (SDLC), the _____ design is created for a specific platform, such
Firlakuza [10]

Answer:

The answer is "physical design"

Explanation:

This design is the method of translating the specification of circuits into a physical design that explains how cells and roads connect. It is an architecture, that involves the system's internal processes of input and output.

  • This system is created by establishing the design criteria, which determines basically what the applicant system is doing.  
  • It includes the architecture, process architecture and software design of user interfaces.
6 0
2 years ago
Write a declaration of a variable named count that can be used to hold numbers like 90000 and -1 and -406.
Andreyy89
Which language? In Java it would simply be:

int count;
7 0
2 years ago
Matthew is working to select an authentication method for his company that will support REST as well as many web-based and mobil
vitfil [10]

Answer:

C) OpenID Connect

Explanation:

The best option is OpenID Connect because is based in OAuth, and supports multiple web based and mobile clients, and supports REST.

With OAuth, we cannot make any user authentication just provide a token to access data.

RADIUS is a networking protocol, and Shibboleth is a single sign-on log-in system for computer networks and the Internet, both not support REST.

6 0
2 years ago
Y’all think Super Drags is good?
Kryger [21]

Yeah, I'm into it. It does show a lot of stereotypical views on drag queens, and it goes a little over the top, but honestly? The LGBT community has spent so long acting like the general population, and we're expected to be a sort of cookie cutter outline of the ideal person in order to fit in. We're not really allowed to be silly and have fun, otherwise we just get labeled as a stereotype, which sucks. When you're queer, you get labeled as that before anything else: your interests are seen as a byproduct of your queerness, not as an interest. So Super Drags, is actually a nice sort of change of pace. It's silly, it shows that queer people are human, and it sorta shows that "Yass bih" look on life, which is hilarious imo. Plus hey, Brazilian LGBT show that doesn't spout homophobic propaganda and supports diversity within all aspects of life? I'll support that.

TLDR; There aren't many silly shows out there that have an LGBT cast. Like, it's always supposed to be grim and sad, and all about heartbreak and coming out, yadda yadda yadda. So, it's cool that we've finally got something lighthearted.

3 0
3 years ago
Other questions:
  • Creating calendar events prevents individuals from being able to schedule a time to collaborate.
    11·1 answer
  • The Security Development Life Cycle (SDLC) is a general methodology for the design and implementation of an information system.
    5·1 answer
  • To give your app users the ability to open your app directly from other apps by clicking a link, you should use:.
    11·1 answer
  • What are the most commonly found items in the trash according to the Municipal Solid Waste report?
    12·2 answers
  • Data stored on physical storage devices must do what before the processor can access it? Be converted to binary Be written to th
    9·1 answer
  • I need help thanks please!
    8·2 answers
  • Give an essay on a way I can be a better person. If not correct I will refund. Best answer gets brainiest. Detailed, 5 sentience
    10·2 answers
  • A customer wants to increase his storage capacity by 25gb
    7·1 answer
  • What is an automatic update and when should you use it
    10·1 answer
  • Wi-Fi Protected Access (WPA) fixes critical vulnerabilities in the earlier wired equivalent privacy (WEP) standard. Understandin
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!