Write a program called root py program


Problem

Write a program called root.py (a variant of the sqrt.py program we dicussed in class) that accepts k: (int), c (Roat), and epsilon (float) as command-line arguments, and writes to standard output the kth root of c, up to epsilon decimal places.

Directions:

1) Set t (our guess) to c.
2) Repeat as long as |1 - c/t*| > €:
a) Replace t by t - f(t) / S' (t), where f(t) = t*
b) c and f' (t) = ktk-1.
3) Write t (the kth root of c).

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Write a program called root py program
Reference No:- TGS03323561

Expected delivery within 24 Hours