Skip to main content
1-Visitor
November 11, 2015
Question

Iterative Programming.xmcd

  • November 11, 2015
  • 2 replies
  • 1423 views

To community:

The attached worksheet shows two programs.

The one on the left shows one way of repeating a calculation that works and accomplishes what it is supposed to do.

The one on the right is an attempt to0 do the same by iterating the calculations but only goes into a recursive mode.

Would like help in the proper programming procedure.

Thanks for any help

Dick.....

2 replies

1-Visitor
November 11, 2015

Please create a discussion within the community. You have created a document which does not allow other users to post worksheets.

23-Emerald V
November 11, 2015

You've accidentally typed the t<-t+1 outside the while loop rather than inside it (technically, it's infinitely iterating rather than recursing).  The picture below shows the effect of putting the t increment back inside the while loop.

Stuart