how to estimate the phase parameter of a complex function?

C++ program for square root?

  • This has to be exactly as follows: Write a function called squareRoot that calculates and returns the square root of the function's first float parameter. The calculation should be within a margin of error provided by the function's second float parameter. Calculating Square Roots You should use a loop to calculate the square root thorough successive approximations. Pseudocode for this process is shown below, where error is the margin of error, x is the value whose square root is to be calculated and estimate is the estimate of the square root. set estimate to 1 set difference to the absolute value of x - estimate2 while(difference > error) set quotient to x / estimate set estimate to (estimate + quotient) / 2 set difference to the absolute value of x - estimate2 end while Examples § printf("%.4f\n", squareRoot(25, .001)); should print 5.0000 § printf("%.4f\n", squareRoot(2745.68, .001)); should print 52.3992 § printf("%.4f\n", squareRoot(17, .001)); should print 4.1231

  • Answer:

    Don't bother submitting your assignment in unless you do it yourself. It's okay to ask for help, but demanding people to write out programs from cmpt 120/128 is prohibited. Your yahoo questions have been noted.

J. at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

you should really try yourself and show your work. Programming is hands on work and practice, but here you go: //i didnn't test it very much double sqrrot(double inval, double err) { double result; double diff; double quot; for(result = 1;;) { quot = inval/result; result = (result +quot)/2.0; if(((result*result)-inval)<=err) break; } return result; }

YouSA

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.