Question: Show the definition of sum by drawing a contour diagram for the code below. Show one contour diagram indicated by the * and another diagram

Show the definition of sum by drawing a contour diagram for the code below. Show one contour diagram indicated by the * and another diagram for the **. For each * and ** draw a static and a dynamic scoped contour diagram.

begin

integer sumf;

real procedure f(x);

       value x; real x;

        f := x * x;

real proecedure sum;

    begin real S, x; s:= 0; s:=0;

        for x := x + 0.01 while x <= 1 do

            S := S + f(x);

        sum := S / 100;

     end;

begin

      real procedure f(x);

          value x; real x;

        f := x^2 + 1;

      sumf := sum;                              *

end;

begin

      real procedure f(x);

          value x; real x;

          f := cos(x) + sin(x);

      sumf := sum;                              **

end;

end;

Step by Step Solution

3.46 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer Contour plots also called level plots are a tool for doing multivariate analysis and visualiz... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!