W15-Struct_Func2

W15-Struct_Func2 - Functions 2 10/24/05 1 Program Design...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
10/24/05 1 Functions 2 10/24/05 2 Program Design • Top-down design (or step-wise refinement) • Start with total problem and break into sub- problems, then into sub-sub-problems, etc. • Make functions for each sub-problem. • main() solves whole by calling f1(), f2(), f3(). • f1() solves sub-problem by calling f4(), f5(), etc. 10/24/05 3 C Program Structure main fcn1 fcn2 fcn3 fcn4 fcn5 fcn6 calls calls calls
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10/24/05 4 Extended In-Class Example Simple Animation Algorithm 1) Draw a figure on the screen at (x, y). 2) Pause a bit. 3) Erase the figure. 4) Change x and/or y a small amount. 5) Check for screen boundries. 6) Repeat from step 1) 10/24/05 5 conio.h Library _gotoxy(int x, int y) – positions console screen cursor at column x, row y. _textcolor(int color) – sets the text foreground color for future screen writes.
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/28/2009 for the course CS 151 taught by Professor Staff during the Spring '08 term at Oregon State.

Page1 / 3

W15-Struct_Func2 - Functions 2 10/24/05 1 Program Design...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online