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
Eva8 [605]
3 years ago
13

Develop a Python module that will prompt the user for a target sum that is greater than 0 and less than 1 for the following Geom

etric series: Geometric Series Equation The program should first make sure the target sum is within the range specified above. If not, continue to prompt the user for a target sum until it is in the specified range. The program should then compute the Geometric Series until it is greater than or equal to the target sum. The program should output the final sum as well as the number of terms required in the sequence to reach that final sum.
Computers and Technology
1 answer:
marusya05 [52]3 years ago
8 0

Answer:

see explaination

Explanation:

target_sum=float(input("Enter a target sum > 0 and <1 : ")) #asking user to enter the sum

while (target_sum<0 or target_sum>1): #if target sum not in range print the message

print("The target sum is not between 0 and 1")

target_sum=float(input("Please Enter a target sum > 0 and <1 : "))

computed_sum=0.00 #declare computed_sum

term_count=0 #declare term count and initalize to 0

r=1 #variable used to create the difference value

while computed_sum<target_sum: #iterate loop till computed sum is less than target sum

computed_sum=computed_sum+(1/(2**r)) #add previous computed sum with current term (1/2,1/4,1/8 etc)

term_count+=1 #increment term count

r+=1 #increment r value

print("Final Sum = " ,computed_sum) #finally print term count and final sum

print("Number of Terms= " ,term_count)

You might be interested in
Frank accidently overwrote his old document with a new document of the same name. He'd like to get his old document back. What f
Archy [21]

Answer:

the recycle bin?

Explanation:

usually when you overwrite something or delete it, it doesn't get entirely deleted rather stored in the recycle bin on your desktop i believe, and so you could retrieve applications through there

4 0
2 years ago
HURRY PLS!!! BRAINLIEST!!
Luda [366]

Answer: 1. Project Manager

2. Web designer

3. Graphic Designer

4. Web developer

Explanation:

I hope you understand

4 0
3 years ago
A user has multiple web pages open and is using email. Which layer of the Transmission Control Protocol/Internet Protocol (TCP/I
Ymorist [56]

Answer: Transport layer

Explanation: The Transmission Control Protocol / Internet Protocol both combine to aid aod transmission of data through the internet. While the Transmission control protocol handles the establishment and Maintainace of network connection through applications , the Internet Protocol handles how the established data is being sent. The Transmission Control Protocol is forms a part of the transport layer which aids in the data transmission m ensuring that data is sent to the correct source. The transport layer is able to avoid errors as it ensures that established c is nnectio is maintained until data exchange is complete.

8 0
2 years ago
A positive return on investment for higher education.
lesya692 [45]

Answer: is when your earnings potential is higher than the cost of your education

Explanation:

A positive return on investment on a particular thing occurs when the benefit derived is more than the cost that was incurred while in a scenario whereby the cost is more than the benefit, a negative return on investment took place.

In this case, a positive return on investment for higher education occurs when your earnings potential is higher than the cost of your education.

5 0
2 years ago
What is a example of a static web page. A. the about us page
inessss [21]

Answer:

bbbbbbbbbbbbbbbbbbbbb

5 0
3 years ago
Read 2 more answers
Other questions:
  • Use ________ resolution when recording human speech in an audio file.
    14·1 answer
  • To keep a desktop computer or a server powered up when the electricity goes off in addition to protection against power fluctuat
    8·2 answers
  • "when a dynamic web page is requested, the web server passes the request to"
    15·1 answer
  • Write the definition of a function named printstarbucks that receives a non-negative integer n and prints a line consisting of n
    6·1 answer
  • AWT
    7·1 answer
  • In what ways do you think the media should function in a democratic society?
    9·1 answer
  • can somebody tell me what straykids 2021 collab is gonna be with because i think its gonna be with blackpink
    9·2 answers
  • What are two examples of ways an electronic record may be distributed to others
    12·1 answer
  • Amanda wants to prevent sensitive data from being sent via email in her organization. What type of agent software can she instal
    15·1 answer
  • A for construct is a loop construct that processes a specified list of objects. As a result, it is executed as long as there are
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!