functions a - Learning Goals Department of Computer Science...

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

View Full Document Right Arrow Icon
1 Functions Part Department of Computer Science APSC 160 Functions Part I Learning Goals By the end of this section, you should be able to: • use functions to represent problem decomposition in programs • read a program that incorporates multiple functions • provide at least four benefits of using functions in programs Modular Programming with Functions Modular Programming with Functions Example: Write a program that prompts the user for the size of an equilateral triangle and that prints a triangle of asterisks on the screen as illustrated below. size 1 size 2 size 3 *** ** ** *** If the user enters a size that is less than one, there should be no output. Flowchart
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Code Design - Modular Structure Chart main printRow Design - Modular Structure Chart main printRow Design - Modular Structure Chart main printRow Design – Function Interface Specification function external input (e.g. keyboard) external output (e.g. screen) Design – Function Interface Specification function return value external input (e.g. keyboard) external output (e.g. screen) parameters
Background image of page 2
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 02/01/2010 for the course PHYSICS 153 taught by Professor Witt during the Spring '08 term at The University of British Columbia.

Page1 / 4

functions a - Learning Goals Department of Computer Science...

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