Functional Decomposition




Document: Software Engineering 1: Lab Exercises

next Command Line Redirection
up Hints
gif The main() Function

Functional Decomposition

Try to use functional decomposition to break your program into smaller, more manageable pieces. This will make it easier to write, test, and debug.

Where appropriate, consider using the functions get_floating_point() and put_floating_point() defined in the example program sum2.c. You can simply cut and past the relevant section of that program into your own program.

Define a new function of your own, which deals with printing out the results, for one cycle of your calculations. This can then be simply called or invoked from within the while loop of your main() function - which should make the main() function shorter and easier to follow. Note that this function will have to accept two arguments (being the current values for the and co-ordinates).




Document: Software Engineering 1: Lab Exercises

next Command Line Redirection
up Hints
gif The main() Function



McMullin@eeng.dcu.ie
Tue Apr 30 14:15:37 GMT 1996