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
marusya05 [52]
3 years ago
10

Complete the function doubling_time that takes two parameters bal and apr and uses a while loop compute the number of years it t

akes for the initial balance in a bank account to double in value rounded up to the nearest year. The two parameters are: bal: initial balance in the bank account apr: annual percent interest income, this is the percentage (of the balance) that should be added to the balance every year as interest income. For example, if bal is 200 and apr is 10 then the balance should be 220 after the first year. Provided definition: # returns the doubling time of the balance in whole years def doubling_time (bal, apr):
Computers and Technology
1 answer:
worty [1.4K]3 years ago
4 0

Answer:

  1. def doubling_time(bal, apr):
  2.    current_amount = bal  
  3.    year = 0
  4.    while(current_amount < bal * 2):
  5.        current_amount = current_amount + (current_amount * apr/ 100)
  6.        year += 1
  7.    
  8.    return year
  9. print(doubling_time(200, 10))

Explanation:

The solution is written in Python 3.

Firstly create a function that takes two input bal and apr (Line 1). Next set the bal as current amount (Line 2) and create year variable as a counter of year (Line 3).

Create a while loop and set the loop condition to enable the while loop persist so long as the current amount still less than the double of initial balance (Line 4). In the while loop, apply formula to compute the current amount after adding the annual interest and then increment year counter by one (Line 5 -6). The year counter will keep increment until the current amount is double the initial balance and terminate the while loop. Return the year counter as function output (Line 8).

We test the function by passing 200 and 10 as initial balance and annual interest rate, respectively. We shall get return value 8.

You might be interested in
1: define about information system in computer?
kobusy [5.1K]

Explanation:

1. Information system is a collection of people, procedures, software, hardware, and data to provide essential information to run an organization.

2. Thesaurus is a software tool used in Microsoft Word document to provide synonyms and antonyms for a selected word.

3. Computer component refers to a basic physical element that is required by the computer to function.

5 0
3 years ago
. :
Rudik [331]

Answer:

Yes.  I completely agree.

Explanation:

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

Yes.  I completely agree.

7 0
3 years ago
What is the difference between a Network Diagram and a Wiring Semantic?
stiks02 [169]

Answer:

Network diagram is the type of graphical networking chart that is basically used in the various type of computer telecommunication. The network diagram is useful for the networking designer and also for the network engineer for compiling the network documentation in detail.

Wiring semantic is the type of open source prototype platform which basically composed of the programming language and the IDE ( Integrated development environment). The wiring semantic consumer can affect the triggering the new data or information from the existing concepts.

7 0
4 years ago
true or false, the random number generator (data analysis tool) requires you to copy paste special value in order to create stat
Vladimir79 [104]

The random number generator (data analysis tool) requires you to copy paste special value in order to create static random value(s) is a false statement.

<h3>What is the meaning of random number?</h3>

A random number is a pick of a number made seemingly at random from a certain distribution such that the distribution is reproduced when a large collection of these numbers is chosen. Such numbers must almost always be independent in order to prevent relationships between succeeding numbers.

Therefore, a hardware or software algorithm known as a random number generator produces numbers at random from a finite or infinite distribution. Pseudo-random number generators and real random number generators are the two primary varieties of random number generators.

Learn more about random number generator from

brainly.com/question/10352102
#SPJ1

8 0
1 year ago
How do companies use web sites?
kramer

they us websites to look thing up that are need

hope this helps

5 0
4 years ago
Other questions:
  • What type of device is built into a tablet computer and can send data over radio waves to another device such as a laser printer
    10·1 answer
  • Search engines enable you to
    13·2 answers
  • A manager wants to set up an area that is not on the LAN but not quite on the Internet. This area will house servers that will s
    5·1 answer
  • You can use this effect to break a color into a percentage of its full strength.
    13·1 answer
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • At the aquarium Grandma Simpson hugged the dolphin is that passive or active sentence​?
    6·1 answer
  • An application ________ is anyone who writes a computer application for one or more platforms.
    5·1 answer
  • Interruption attacks are also called ___ attacks:
    8·1 answer
  • ) Perform error checking for the data point entries. If any of the following errors occurs, output the appropriate error message
    11·1 answer
  • Why should we not underestimate the widespread of mass media?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!