Chapter 7. Methods: A Deeper Look


The greatest invention of the nineteenth century was the invention of the method of invention.

Alfred North Whitehead

Form ever follows function.

Louis Henri Sullivan

Call me Ishmael.

Herman Melville, Moby Dick

When you call me that, smile!

Owen Wister

O! call back yesterday, bid time return.

William Shakespeare

Answer me in one word.

William Shakespeare

There is a point at which methods devour themselves.

Frantz Fanon

Objectives

In this chapter you will learn:

  • To construct programs modularly from methods.

  • That Shared methods are associated with a class rather than a specific instance of the class.

  • To use common Math methods from the Framework Class Library.

  • To create new methods.

  • The mechanisms used to pass information between methods.

  • Simulation techniques that employ random number generation.

  • How the visibility of identifiers is limited to specific regions of programs.

  • To write and use recursive methods (methods that call themselves).

Outline

7.1 Introduction

7.2 Modules, Classes and Methods

7.3 Subroutines: Methods That Do Not Return a Value

7.4 Functions: Methods That Return a Value

7.5 Shared Methods and Class Math

7.6 GradeBook Case Study: Declaring Methods with Multiple Parameters

7.7 Notes on Declaring and Using Methods

7.8 Method Call Stack and Activation Records

7.9 Implicit Argument Conversions

7.10 Option Strict and Data-Type Conversions

7.11 Value Types and Reference Types

7.12 Framework Class Library Namespaces

7.13 Passing Arguments: Pass-by-Value vs. Pass-by-Reference

7.14 Scope of Declarations

7.15 Case Study: Random Number Generation

7.16 Case Study: A Game of Chance

7.17 Method Overloading

7.18 Optional Parameters

7.19 Recursion

7.20 (Optional) Software Engineering Case Study: Identifying Class Operations in the ATM System

7.21 Wrap-Up



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net