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
HELP 10 POINTS
Masja [62]

Answer:

it's A:state the role each member played in the project

6 0
3 years ago
Create a class ProblemSolution with following characteristics Two private member variables name &amp; designation of string type
Romashka-Z-Leto [24]

Answer:

Please see the attachment for the solution

Explanation:

Download txt
4 0
3 years ago
The Zapper gun was an accessory for which game console?
Vladimir [108]
Nintendo Entertainment System
5 0
3 years ago
Read 2 more answers
) Which of these will not select all the cells in a document?
dolphi86 [110]
Pressing enter two times I’m pretty sure that’s right cuz like it does nothing when I do it. It’s either that or idk up to u to take an answer from someone who has bad grammar
4 0
3 years ago
What are the uses of computer in educational setting?
Arada [10]

Answer:

Quick Communication & Correspondence

Explanation:

Another main advantage of using computers in the education field is the improvement in the quality of teaching-learning process and communication between students & teachers. For this, they use Microsoft PowerPoint to prepare electronic presentations about their lectures.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Write a loop to print 10 to 90 inclusive (this means it should include both the 10 and 90), 10 per line.​
    6·1 answer
  • As the team leader, John ensures that all his teammates are clear in the team goals they need to achieve. He demonstrates the qu
    12·2 answers
  • Follow up, my brother is upset at me for stealing his robux, what should i do?
    11·2 answers
  • 3 Points
    9·2 answers
  • Let's go! About to hit 40k!!! Glad to help on Brainly®!!!
    11·1 answer
  • Fill up the blank:- The picture that graphically represents the items you use in Windows is called a/an .......
    5·1 answer
  • How do you give brianliest
    13·1 answer
  • Which of the examples is part of client-side code?
    12·1 answer
  • By convention only, either the first usable address or the last usable address in a network is assigned to the router (gateway)
    11·1 answer
  • Identify and explain 3 methods of automatically formatting documents​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!