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
Leya [2.2K]
2 years ago
13

The "divide and average" method, an old-time method for approximating the square root of any positive number a, can be formulate

d as:
x= (x +a/x)/2

Write a well-structured M-file function based on the while...break loop structure to implement this algorithm. Use proper indentation so that the structure is clear. At each step estimate the error in your approximation as:

ε= |x^new- x^old/x^new|

Repeat the loop until ε is less than or equal to a specified value. Design your program so that it returns both the result and the error. Make sure that it can evaluate the square root of numbers that are equal to and less than zero. For the latter case, display the result as an imaginary number. For example, the square root of -4 would return 2i. Test your program by evaluating a = 0,2, 10 and-4 for ε = 10^-4

Engineering
1 answer:
Shalnov [3]2 years ago
4 0

Answer:

<u>note:</u>

find the attachment:

You might be interested in
A closed system consisting of 4 lb of a gas undergoes a process during which the relation between pressure and volume is pVn 5 c
gayaneshka [121]

Answer:

V1=5<u>ft3</u>

<u>V2=2ft3</u>

n=1.377

Explanation:

PART A:

the volume of each state is obtained by multiplying the mass by the specific volume in each state

V=volume

v=especific volume

m=mass

V=mv

state 1

V1=m.v1

V1=4lb*1.25ft3/lb=5<u>ft3</u>

state 2

V2=m.v2

V2=4lb*0.5ft3/lb=  <u> 2ft3</u>

PART B:

since the PV ^ n is constant we can equal the equations of state 1 and state 2

P1V1^n=P2V2^n

P1/P2=(V2/V1)^n

ln(P1/P2)=n . ln (V2/V1)

n=ln(P1/P2)/ ln (V2/V1)

n=ln(15/53)/ ln (2/5)

n=1.377

3 0
3 years ago
Which is a reason that teen might choose to focus on a friendship and not a romantic relationship
andrey2020 [161]

Answer: b. To avoid having distractions

Trust me it’s definitely option b

4 0
3 years ago
Read 2 more answers
Handsaw teeth are very sharp: to avoid being cut by the teeth, keep hands and fingers well away from the
siniylev [52]
Handsaw teeth are very sharp: to avoid being cut by the teeth, keep hands and fingers well away from the
path of the blade
6 0
2 years ago
Read 2 more answers
Write an application that reads three integers, adds all three together, computes an average of the three entries, and computes
Natali5045456 [20]

Answer:

//The program prompts user to input three integers and it displays them, adds and gets their average

//begin

public class Test

{

  public static void Main()

  {

     //input intergers

int[] score = new int[3];

      int avg,rem,sum = 0;

     

      for(int i=0;i<3;i++)

      {

      Console.WriteLine("Enter an integer score ");

      score[i] = Convert.ToInt32(Console.ReadLine());

      sum = sum + score[i];

      }

      avg = sum/3;

      rem = sum%3;

     

      Console.WriteLine("The average of "+score[0]+","+score[1]+","+score[2]+" is "+avg +" with a remainder of "+rem);

     

  }

}

3 0
3 years ago
Text that is located between &lt;title &gt;and &lt;/title &gt; appears in the browser's_____​
Vinil7 [7]

Answer:

Tab title

Explanation:

The tab title can be defined as the title that shows up in a browser tab known as page title. The title only has texts, other tags within the texts are not considered.

8 0
2 years ago
Other questions:
  • Explain the differences between 1- Energy 2- Power 3- Work 4- Heat Your answer should explain the mathematica and physical meani
    5·1 answer
  • Three single-phase, 10 kVA, 2400/280 V, 60-Hz transformers are connected to form a three-phase, 2400/480 V transformer The equiv
    15·1 answer
  • For what two reasons do countries specialize? Countries specialize so that opportunity costs can be increased. Countries special
    13·1 answer
  • Free ideas free points. You will be reported for answering "no" or I don't know
    11·1 answer
  • A strain gage is mounted at an angle of 30° with respect to the longitudinal axis of the cylindrical pressure. The pressure vess
    11·1 answer
  • Describe the algorithm you use for looking up a person’s telephone number in the phone book. The input is person’s name; the out
    9·2 answers
  • Effective presentations are: Have a central message Colorful and exciting Have many messages Are influence by a setting Created
    15·2 answers
  • When a company in the United States employs people in India to answer their customer service calls this is an example of
    9·1 answer
  • What is the purpose for this experiment
    9·1 answer
  • A. The ragion was colonized by European powers
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!