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
bogdanovich [222]
3 years ago
5

Implement a recursive program that takes in a number and finds the square of that number through addition. For example if the nu

mber 3 is entered, you would add 3+3+3=9. If 4 is entered you would add 4+4+4+4=16. This program must be implemented using recursion to add the numbers together. mips

Computers and Technology
1 answer:
lubasha [3.4K]3 years ago
3 0

Answer:

def recurSquare(n):

   if n == 0:

       return 0

   return recurSquare(n-1) + n + n-1

print(recurSquare(2))

Explanation:

Programming language used is Python.

The recursive function is defined as  recurSquare(n)

The IF statement checks the argument that is passed to the function to ensure it is not equal to zero.

The function is a recursive function, which means it calls itself.

In the return statement the function calls itself and the argument is reduced by 1.

The function keeps calling itself until n is equal to zero (n == 0) it returns zero and the function stops.

You might be interested in
Our ways of communicating in society will change mostly due to: O A. our desire to be isolated. O B. a population decline. O O C
GalinKa [24]

Answer:C

Explanation:

4 0
3 years ago
Diane, a developer, needs to program a logic component that will allow the user to enter a series of values
oee [108]
<h2>The Examples Of Users:</h2>
  • Form
  • Table
  • Query
<h2>The Answers Are:</h2>
  • Formatted summary of information from a database

  • User-friendly interface for adding to or retrieving information from a database

  • Stores raw data in a relational database

  • Retrieves specific information from a database. Can also be used to update, edit, and remove data
<h2>Hope it helps*^-^*All Correct!?</h2>
3 0
2 years ago
How do you get past a firewall ?
DaniilM [7]
Use a Web-based Proxy. ...
Use a VPN. ...
Use Remote Access to Your Own PC. ...
Kill the Blocking Service. ...
Use Mobile Data as a Stopgap. ...
What if You're Using a Phone? ...
Sneaky Like a Boss.
3 0
3 years ago
Alexander studies sitting on the edge of his bed with his laptop on his lap. he complains of a sore neck. how can he best improv
kumpel [21]

The way in which Alexander can best improve his study area is that: D. he can put his computer on a desk and sit in a comfortable chair.

<h3>What is a laptop?</h3>

A laptop can be defined as a small, portable type of computer that is designed and developed by embedding both a mousepad and keyboard on it.

Also, it is usually light enough to be placed on an end user's lap while he or she is working.

In this scenario, the way in which Alexander can best improve his study area is that he can put his computer on a desk and sit in a comfortable chair.

Read more on a laptop here: brainly.com/question/26021194

#SPJ4

7 0
2 years ago
Write a function called is_present that takes in two parameters: an integer and a list of integers (NOTE that the first paramete
Agata [3.3K]

Answer:

The function in python is as follows

def is_present(num,list):

    stat = False

    if num in list:

         stat = True

       

    return bool(stat)

Explanation:

This defines the function

def is_present(num,list):

This initializes a boolean variable to false

    stat = False

If the integer number is present in the list

    if num in list:

This boolean variable is updated to true

         stat = True

This returns true or false        

    return bool(stat)

7 0
3 years ago
Other questions:
  • A boolean variable named rsvp an int variable named selection, where 1 represents "beef", 2 represents "chicken", 3 represents "
    14·1 answer
  • vulnerability is a feebleness which allows an attacker to condense a system's information assurance to security,is it true or fa
    14·1 answer
  • What problem with internal hardware components is similar to unplugged
    6·2 answers
  • What kind of security features does Microsoft Security Analyzer promise?
    5·1 answer
  • The company database may be stored on a central database server and managed by a database adminstrator true or false
    12·1 answer
  • Liquid-liquid extraction is best suited to separate a mixture of compounds when:
    9·1 answer
  • _________ can be used to provide access control, confidentiality, data origin authentication, connectionless integrity, rejectio
    12·1 answer
  • True or False? Security code is almost always open source!<br> True<br> False
    8·2 answers
  • In how many ways can a list of students names from your class be organized?​
    14·1 answer
  • Which website offers guidance on putting together a checklist to provide guidance on configuring and hardening operating systems
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!