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
Olin [163]
3 years ago
10

write a function interest() that takes one input, a floating-point interest rate (e.g., 0.06, which corresponds to a 6% interest

rate). your function should compute and return how long (in years) it will take for an investment to double in value. note: the number of years it takes for an investment to double does not depend on the value of the initial investment.
Computers and Technology
1 answer:
Novay_Z [31]3 years ago
8 0

Code:

def interest():

   interest_rate = 0.06

   investment = input(int('Investment: '))

   yield = 0

   year = 0

   while (yield < investment):

       year += 1

       yield  = investment * interest_rate

   print (year)

NOTE: i wrote this code assuming that the investment for the next year is the same as the first year and so forth

You might be interested in
Give a big-O estimate for the number of operations,
Kazeer [188]

Answer:

Explanation:

For the first iteration of i for loop 1 to n, the j for loop will run from 2 to n times. i.e. n-1 times.

For the second iteration of i for loop, the j for loop will run from 3 to n times. i.e. n-2 times.

From the third to the last iteration of i for loop, the j for loop will run n-1 to n times. i.e. 2 times.

From the second to the last iteration of i for loop, the j for loop will run from n to n times. i.e. 1 time.

For the last iteration of i for loop, the j for loop will run 0 times because i+1 >n.

Hence the equation looks like below:

1 + 2 + 3 + ...... + (n-2) + (n-1) = n(n-1)/2

So the number of total iterations is n(n-1)/2.

There are two operations per loop, i.e. Comparison and Multiplication, so the iteration is 2 * n(n-1)/2 = n ^2 - n

So f(n) = n ^ 2 - n

f(n) <= n ^ 2 for n > 1

Hence, The algorithm is O(n^2) with C = 1 and k = 1.

6 0
4 years ago
3) An algorithm has a run time of O(nk ) for some integer k. On an input of size 500, the algorithm takes 16 seconds to run. On
lukranit [14]

Answer:

The value of k is 4

Explanation:

Solution

Given that:

k = integer

Input size = 500

The algorithm takes a run of = 16 seconds

Input size = 750

The algorithm takes a run of = 81 seconds

Now,

We have to determine the value of k

The equation is shown below:

(500)^k /16 = (750) ^k /81

Thus

(750/500)^ k = 81/16

= (3/2)^k

=(3/2)^ 4

k is = 4

6 0
3 years ago
Which option in Outlook allows a user to look at multiple calendars in a side-by-side fashion?
Thepotemich [5.8K]

Answer:

Its A

Explanation:

I just took the review

8 0
4 years ago
Read 2 more answers
A 32-bit number that's used to keep track of where you are in a sequence of TCP segments is known as a(n) ______ number.
scoray [572]

A <u>sequence</u> number is a 32-bit number that's used to indicate where you are in a sequence of TCP segments.

<h3>What is TCP?</h3>

TCP is an acronym for Transmission Control Protocol and it is an essential and important standard protocol of the Internet protocol network.

In Computer technology, TCP is an essential part of the transmission control protocol and internet protocol (TCP/IP) network which has a wide range of applications in the following areas:

  • File transfers
  • World wide web (WWW).
  • Remote administration
  • E-mail

In TCP segments, a <u>sequence</u> number is a 32-bit number that's typically used to indicate where an end user is in a sequence.

Read more on TCP here: brainly.com/question/17387945

8 0
2 years ago
Which networking model can the network now support that it could not support without the addition of the eighth computer?
ValentinkaMS [17]

I guess the correct answer is cliеnt-sеrvеr mοdеl

Thе cliеnt-sеrvеr mοdеl is a distributеd cοmmunicatiοn framеwοrk οf nеtwοrk prοcеssеs amοng sеrvicе rеquеstοrs, cliеnts and sеrvicе prοvidеrs. Thе cliеnt-sеrvеr cοnnеctiοn is еstablishеd thrοugh a nеtwοrk οr thе Intеrnеt.

Thе cliеnt-sеrvеr mοdеl is a cοrе nеtwοrk cοmputing cοncеpt alsο building functiοnality fοr еmail еxchangе and Wеb/databasе accеss. Wеb tеchnοlοgiеs and prοtοcοls built arοund thе cliеnt-sеrvеr mοdеl arе:

  • Hypеrtеxt Transfеr Prοtοcοl (HTTP)
  • Dοmain Namе Systеm (DNS)
  • Simplе Mail Transfеr Prοtοcοl (SMTP)
  • Tеlnеt

Cliеnts includе Wеb brοwsеrs, chat applicatiοns, and еmail sοftwarе, amοng οthеrs. Sеrvеrs includе Wеb, databasе, applicatiοn, chat and еmail, еtc.

4 0
4 years ago
Other questions:
  • You have no control over who view your post
    10·1 answer
  • An algorithmic function that takes an input message of arbitrary length and returns an output of fixed-length is called a(n) ___
    10·1 answer
  • gAssume that you are writing a program to merge two files named FallStudents and SpringStudents. Each file contains a list of st
    15·1 answer
  • Print the two strings in alphabetical order. assume the strings are lowercase. end with newline. sample output: capes rabbits
    5·2 answers
  • Which type of storage disk and disk drive can be used in the given situation? Amy wants to borrow an interesting movie from Bruc
    10·2 answers
  • Que significa el término “Informática”?
    11·1 answer
  • Write the following program: Use struct data type to store information about courses. Every course is characterized by the follo
    6·1 answer
  • Enter the word that belongs in the blank:
    13·1 answer
  • A central issue of public sharing is:
    13·2 answers
  • Identify a possible IOT (internet of Things) device in a smart kitchen and write a use case for interacting with the software of
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!