+1-617-874-1011 (US)
+61-7-5641-0117 (AU)
+44-117-230-1145 (UK)
Live Chat

Project 1 / Functions - A Newton Scanner

Project 1

Please develop the function ScanForRoots to scan a given function f(x) for it’s roots using the newton’s algorithm.

The Interface

The program should read the following input parameters from an input file. The file’s format is given as follows.

  • [max number of roots to find]
  • [lower bound: lb] [upper bound: up] [step width: sw]
  • [precision eps] [stepwidth h] [max iteration: ix]

The program should search the root of a function with the starting position x0. The starting position x0 should be taken from the interval which is described by the parameters ub, lb and sw read from the input file. The found roots of the function should be saved in an dynamical array, which should be a parameter of the function ScanForRoots The size of the array should be set by a parameter, which is read from the input file.

An example data file is given below.

  • 10
  • -10. +10. 0.1
  • e-7 0.01 100

In the project a reasonable interval should be selected to be able to check the quality of the developed software.

The Function ScanForRoots

So the interface to ScanForRoots is the following.

integer function ScanForRouts(f,lb,ub,sw,eps,h,maxit,roots)


Type Comment


function function to analyse



lower bound of search interval



upper bound of search interval



step width for the starting position x0



precision for the newton algorithm



maximal number of iteration for one root search



one indexed array for the found roots

The return value of ScanForRoots should give the number of found roots. The roots should not be stored multiple.

The main program which should call ScanForRoots should do the following.

  • open, read and close the input file ScanForRoots.inp.
  • call ScanForRoots1 to search for the function’s roots.
  • write a little report which gives a list of the found roots
Improve Your Grades with Custom Writing Help
Homework Help
Writing Help
Editing Services
Plagiarism check
Proofreading services
Research Project help
Custom writing services
E learning blogs

Disclaimer : The study tools and academic assistance/guidance through online tutoring sessions provided by AssignmentHelp.Net is to help and enable students to compete academically. The website does not provide ghostwriting services and has ZERO TOLERANCE towards misuse of the services. In case any user is found misusing our services, the user's account will be immediately terminated.