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
vovikov84 [41]
3 years ago
7

Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This

function expects the input number as an argument and returns the estimate of its square root. The script should also include a main function that allows the user to compute square roots of inputs until she presses the enter/return key
Computers and Technology
1 answer:
Shtirlitz [24]3 years ago
7 0

Answer:

def newton(n):

       #Define the variables.

       t = 0.000001

       esti = 1.0

       #Calculate the square root

       #using newton method.

       while True:

               esti = (esti + n / esti) / 2

               dif = abs(n - esti ** 2)

               if dif <= t:

                       break

   

       #Return the result.

       return esti

#Define the main function.

def main():

   

       #Continue until user press enters.

       while True:

               try:

         

                       #Prompt the user for input.

                       n = int(input("Enter a number (Press Enter to stop):"))

                       #display the results.

                       print("newton = %0.15f" % newton(n))

     

               except:

                       return

#Call the main function.

main()

You might be interested in
Which person would be the best fit for a career in the Information Technology field?
zaharov [31]
The best possible fit would be a person with a creative mind and flexible mind. 
The technical stuff can be taught and learnt. But to evolve and keep up with the pace of how technology improves day to day, you'd need some with flexibility to cope up with this and creativeness to make innovations.
6 0
2 years ago
Read 2 more answers
John is analyzing strange behavior on computers in his network. He believes there is malware on the machines. The symptoms inclu
enot [183]

Answer:

Boot Sector Virus

Explanation:

A malicious software or malware is an executable line of code, programmed by a cybercriminal for ill intentions. There are many types of malware namely; viruses, rootkit, keylogger, trojan horse etc.

A boot sector virus is a kind of malware that runs before the operating system, affecting the boot sector of the hard disk, so even when a linux live cd is running as the operating system, the virus is still active.

5 0
3 years ago
The process that uses 3D modeling software to create a representation of a three dimensional object is called 3D modeling.
MissTica
This statement is (True)
5 0
3 years ago
Read 2 more answers
1. Write a high level algorithm for cooking a cheeseburger.
pishuonlain [190]

Answer:

1.  A high level algorithm for cooking a cheeseburger could be:

  1. Heat fry pan
  2. Cook one side of the hamburger
  3. Wait
  4. Turn hamburger upside down
  5. Put cheese over hamburger
  6. Wait
  7. Cut hamburger bread in half
  8. Put cooked hamburger inside bread
  9. End (eat)

2. A detailed algorithm for cooking a cheeseburger could be:

  1. Place fry pan over the stove heater
  2. Turn on heater (max temp)
  3. IF fry pan not hot: wait, else continue
  4. Place raw hamburger on fry pan
  5. IF hamburger not half cooked: Wait X time then go to line 5, else continue
  6. Turn hamburger upside down
  7. Put N slices of cheese over hamburger
  8. IF hamburger not fully cooked: Wait X time then go to line 8, else continue
  9. Turn off heater
  10. Cut hamburger bread in half horizontally
  11. Put cooked hamburger on one of the bread halves.
  12. Put second bread half on top of hamburger
  13. End (eat)

Explanation:

An algorithm is simply a list of steps to perform a defined action.

On 1, we described the most relevant steps to cook a simple cheeseburger.

Then on point 2, the same steps were taken and expanded with more detailed steps and conditions required to continue executing the following steps.

In computational terms, we used pseudo-code for the algorithm, since this is a list of actions not specific to any programming language.

Also we can say this is a structured programming example due to the sequential nature of the cooking process.

7 0
3 years ago
You can post a Facebook status update from your smartphone. True or false?
Nady [450]
True .................
3 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following cannot be performed from the windows task manager?
    15·2 answers
  • Your network administrator finds a virus in the network software. Fortunately,
    13·1 answer
  • O novo funcionário da equipe de desenvolvimento de sistemas está aprendendo os termos mais utilizados no dia a dia da empresa. A
    7·1 answer
  • PLEASE HELP ME ASP<br> An ISDN carries a signal in digital form.<br><br> True<br><br> False
    12·2 answers
  • To create a formula in. . You would first click in one of the cells
    12·2 answers
  • 16 to 19 year old drivers are how many more times likely to crash? 1.7,2.7,0.7 ,3.7
    12·2 answers
  • Should the use of hacktivists by a country against enemy organizations be considered an act of war? Why or why not? How about th
    8·1 answer
  • What is the primary means by which attackers infect computers with these attacks? How do these attacks commonly occur?
    8·1 answer
  • Write a 3-4 page paper (500-800 words) about your project that explains your project, the type of conditioning you used, and the
    10·1 answer
  • In order to be an effective employee who knows recent information on loans and laws, in what topic should your information be cu
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!