A Brief Source Code Analysis

   


We will go deeper into the C# syntax and structure in Chapter 3, "A Guided Tour through C#: Part I" but, for now it can be educational to have a quick look through the source code and compare it with the pseudocode provided in Listing 2.2. This listing is the Shakespeare.cs program written in pseudocode and with line numbers corresponding exactly to Listing 2.1. In other words, line 1 of Listing 2.2 briefly explains line 1 of Listing 2.1, line 2 of Listing 2.2 explains line 2 of Listing 2.1, and so on.

Listing 2.2 Pseudocode for the Shakespeare Program
01:   Facilitate use of classes belonging to the System part of the BCL 02:   Begin definition of a class called Shakespeare 03:   Begin block in which the Shakespeare class definition is written. 04:           Indicate with Main where the program execution will start 05:           Begin block, which will be executed when Main is started. 06:                   Print: "Though this be madness" on the console and move down one  graphics/ccc.gifline 07:                   Print: "yet there is method in it" on the console and move down one  graphics/ccc.gifline 08:                   Print: "William Shakespeare" on the console and move down one line 09:          End block, which was executed when Main was started 10: End block in which the Shakespeare class definition is written.  

   


C# Primer Plus
C Primer Plus (5th Edition)
ISBN: 0672326965
EAN: 2147483647
Year: 2000
Pages: 286
Authors: Stephen Prata

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