The next three lines illustrate what I want for each input on Mathematica Assignment 1: input, output, and a brief explanation in a Text cell.

2 + 2

Obviously, 2 +2 is 4.

Here's a quick implementation of Newton's method that generates a list of computed elements in the sequence.   Note that here I have assigned a name "newt" to the output so I can reference it later.

f[x_] = x^2 - 2;
x0 = 1. ;
newt = Table[x0 = x0 - f[x0]/f'[x0], {n, 1, 5}]

In class, there was a question about formatting output to display more digits.  I used FullForm in class, but NumberForm is more appropriate as the latter only impacts the formatting of numbers.

FullForm[newt]

NumberForm[newt, 16]

We next implement a stopping criterion based on a specified tolerance.  One way uses the value of |f(x)| as implemented next.

f[x_] = x^2 - 2;
x0 = 1. ;
tol = 10^-15;
While[Abs[f[x0]] > tol, 
x0 = x0 - f[x0]/f'[x0]; 
      Print[NumberForm[x0, 16]]]

A second way uses the value of |((Subscript[x, n + 1]) - 
              (Subscript[x, n]) | /|(Subscript[x, n + 1]).

f[x_] = x^2 - 2;
x0 = 1. ;
tol = 10^-15;
x1 = x0 - f[x0]/f'[x0];
While[
      Abs[(x1 - x0)/x1] > tol, 
x0 = 
        x1; 
x1 = 
        x0 - f[x0]/f'[x0]; 
Print[
        NumberForm[x0, 16]];]

A third way uses the value of |((Subscript[x, n + 1]) - (Subscript[x, n])|.

f[x_] = x^2 - 2;
x0 = 1. ;
tol = 10^-15;
x1 = x0 - f[x0]/f'[x0];
While[
      Abs[x1 - x0] > tol, 
x0 = x1; 
x1 = 
        x0 - f[x0]/f'[x0]; 
Print[
        NumberForm[x0, 16]];]

For comparison, here's Mathematica's value of (Sqrt[2]).

N[Sqrt[2], 20]

Recall that we entered a non-ending loop when we ran the above implementations with tol set to (10^(-16)).  To avoid this, we should include a maximum number of iterations.  Note that I have included a message to be printed if the maximum number of iterations has been reached.

f[x_] = x^2 - 2;
x0 = 1. ;
maxits = 10;
tol = 10^-16;
i = 1;
x1 = x0 - f[x0]/f'[x0];
While[
      Abs[(x1 - x0)/x1] > tol  &&  i++ < 
          maxits, 
x0 = x1; 
x1 = 
        x0 - f[x0]/f'[x0]; 
Print[
        NumberForm[x0, 16]];]
If[i >= maxits - 1, 
      Print["reached maximum number of iterations"]]