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
NEED HELP RIGHT NOW!!! Which of the following is the definition of a privacy policy? * 5 points - A legal document that an app o
Marina86 [1]

Answer:

A legal document that an app or a website must provide to describe the rules the company and users must obey when they use the app.

6 0
3 years ago
What bit position in an ascii code must be complemented to change the ascii letter represented from uppercase to lowercase and v
MariettaO [177]
Flip bit position 5 to accomplish this. This maps to hex value 0x20, where the least significant bit is assumed to be at position 0.

Example: ascii "A" = 0x41, "a" = 0x61.  0x41 xor 0x61 = 0x20.

You would implement a flip function by XOR'ing the character value with 0x20.
4 0
3 years ago
A _____ is usually a smaller version of a data warehouse
Strike441 [17]
A ( micro ) is usually a smaller version of a data warehouse
4 0
3 years ago
Write a report on the effectiveness of using thicker bags. Remember to include the effect on the environment and the economy in
malfutka [58]

The effectiveness of using thicker bags are:

  • It has the lowest environmental impact in terms of any other disposable bag.
  • It can be used three to six more times.
  • It is environmentally sustainable.

<h3>What is the effect of thicker plastic bags have on the environment?</h3>

The use of plastic bags is known to have some form of detrimental effects on the such as animal choking, pollution, and others.

Conclusively, Note that thicker bags needs a lot of plastic to be able to produce it and it goes to waste even if a person do not use it again.

Learn more about environment from

brainly.com/question/17413226

4 0
2 years ago
Endnotes are indicated by
V125BC [204]

Answer:

The answer is D because u have the uppercase letter bold

4 0
3 years ago
Read 2 more answers
Other questions:
  • In your own words, explain the role of scientific investigation in the development of the Theory of Evolution.
    6·1 answer
  • Advantages of a personal area network
    5·1 answer
  • In the process of benchmarking for a variable expense (such as payroll) the typical metrics used are "Total Dollars" and "Dollar
    8·1 answer
  • Classes cannot:
    10·1 answer
  • A user prefers an external monitor, mouse, and keyboard for a laptop. The user does not want to use the built-in screen; however
    5·1 answer
  • Name the different type of vegetation found in India ?​
    8·2 answers
  • What is a multipurpose network device?
    10·1 answer
  • G i r l s o n l y j o i n <br> id= ons jcuv jke
    13·2 answers
  • ASAP PLS HELP: I’ll give brainliest if you u answer them all correctly!!
    12·2 answers
  • At a commercial quick charge station, a fully depleted 87 kwh battery in 2023 ariya can be charged from 20% to 80% in about ____
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!