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
Write a recursive function using pseudocode or C/C++.
Anarel [89]

Answer:

long fact(int n)

{

   if(n<=1)//base case

   return 1;  

   long p=fact(n-1);//recursive call.

   return n*p;//returning the factorial.

}

Explanation:

Above written function is written in C++ language.It is a recursive function to find the factorial of the function.

If we enter a number  equal to  or  less than  1  then the function returns 1. Then the recursive call  is made  and it is stored  in the long  variable  p and  the result is returned as n*p.

5 0
4 years ago
Non-delivered goods, counterfeit products, fraudulent payments are common type of cyber crime these
Arisa [49]

Answer:

a. Internet auction fraud

b. Counterfeit products are products made and/or sold under the brand name of a product of a higher quality

c. 1) Monitor business transactions

2) Use an Address Verification System AVS

Explanation:

a. Such types of cyber crimes are collectively called Internet auction fraud

Internet or online auction fraud is a form of fraud that involves the act of providing misleading information about goods paced on advert for sale on an online auction site, including the sale of counterfeit goods, sale of goods of poor quality, receiving a different item from what was ordered, artificial bidding to increase price, omission of important information about a product, delivering an item that looks different from what was displayed on the website and the non-delivery of an item already to the buyer.

A seller can be a victim of the internet auction fraud when a buyer does not pay for goods an/or services received, request for delivery before payment, the buyer pays with a stolen credit card, the buyer uses a fake escrow account such that the money returns to the buyer after receiving the goods

b. Counterfeit products or goods are products that are being manufactured and marketed, without formal authorization, under the name of a popular and recognized but are usually of lesser quality than the product they try to imitate

c. Measures that can be taken to stop fraudulent payments are;

1) Monitor transactions to to check for red flags, including disparity in shipping and billing information

Monitor transactions from customer that use free or anonymous emails services which can easily be opened and closed without payment or proper  documentation

2) Make use of Address Verification System to authenticate the billing address on a payment, and the address on the credit card.

7 0
3 years ago
When looking at security standard and compliance, which three (3) are characteristics of best practices, baselines and framework
Brilliant_brown [7]

Answer:

In order to observe best practices, and to meet with technical and other requirements, organizations often use frameworks for cybersecurity compliance and regulatory compliance. These frameworks provide best practices and guidelines to assist in improving security, optimizing business processes, meeting regulatory requirements, and performing other tasks necessary to achieve specific business objectives such as breaking into a particular market niche or selling to government agencies.

Many such frameworks exist, and the recommendations set out in them can impose difficult and often expensive demands on enterprise resources – especially in situations where an organization is subject to a number of regulatory compliance regimes, whose requirements it has to meet while maintaining its own strong cybersecurity status.

Explanation:

4 0
3 years ago
For any element in keysList with a value smaller than 40, print the corresponding value in itemsList, followed by a comma (no sp
givi [52]

Answer:

u look se33y yessir

Explanation:

......................................

7 0
3 years ago
Write a C Program to Print the initial letter of Name Ferdous
Murrr4er [49]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The question is about writing a C program that prints the initial letter of Name Ferdous.

Therefore, below is the given complete code that prints the first letter of the name Ferdous.

<em>#include <stdio.h> </em><em>/*import strandard input/output library*/</em>

<em>#include<string.h></em><em> /*import string library to handle string type of data*/</em>

<em> </em>

<em>int main(void) </em><em> /*started the program execution- program entry point*/</em>

<em>{ </em>

<em>char *str = "Firdous";</em><em>   /*char to pointer str contains string "Firdous"*/</em>

<em>int len = strlen(str);  </em><em> /*this line of code is not neccary, but if you print other character for example last character of the name then you can use it*/</em>

<em>printf("First Letter of the name is: %c", str[0]); </em><em>  /*print first letter of the name*/</em>

<em>} </em><em>  /**program terminated*/</em>

5 0
3 years ago
Other questions:
  • To extend the bottom border of a hyperlink across the complete width of a navigation list, change the ____ property of each hype
    9·1 answer
  • Are there protections for people in terms of what data can be collected by different sites?
    10·1 answer
  • hey computor guys. is the MSI B250M GAMING PRO LGA 1151 Intel B250 HDMI SATA 6Gb/s USB 3.1 Micro ATX Motherboards - Intel compat
    8·1 answer
  • A résumé can be delivered through _____.a.
    9·2 answers
  • In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all
    7·1 answer
  • HELP ME PLEASEEEE
    8·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    5·1 answer
  • Who developed the first personal computer called the altair
    15·1 answer
  • Which document outlines the activities carried out during testing?
    9·1 answer
  • What information will she need to know in order to obtain assistance from the chief medical officer to reduce the number of deli
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!