Learning Visual C# 2008 How To Program Part 1

 

Visual C# 2008 How to Program, 3rd Edition

By Paul Deitel Published Sep 18, 2008 by Prentice Hall. Part of the Pearson Custom Computer Science series.
Copyright 2009
Dimensions: 7″ x 9-1/8″
Pages: 1600
Edition: 3rd
Book
ISBN-10: 0-13-605322-X
ISBN-13: 978-0-13-605322-4

[info_box] In order to learn Visual C# I chose the book recommended in school called Visual C# 2008 How To Program.  I learn through experience and excellent notes!  This will allow me to update this blog and track my growth as I complete the book. If you have an opinion on anything written here, I welcome the discussion and in turn I am sure there’s always something new to learn. This first post will be an overview of the basic terms related to programming in C#. [/info_box]

Basic Object -Technology Concepts

Languages like C# are object oriented. Programming in such a language is called Object-Oriented Programming (OOP).

Objects: e.g. People, Animals, Plants, Cars etc..

  • Objects are often divided into two categories – Animate and Inanimate
  • Animate objects are “Alive”- They move around and do things.
  • Inanimate objects do not move on their own.
  • All objects have Attributes
  • All objects exhibit Behaviors

Attributes: e.g. Size, Shape, Color and Weight

Behaviors: e.g. A Ball Rolls, Bounces, Inflates and Deflates

Object-Oriented Design (OOD): Encapsulates (i.e., wraps) attributes and operations (behaviors) into Objects.

Classes, Fields and Methods

C# programmers concentrate on creating their own user-defined types called classes.

  • Each class contains data as well as the set of methods that manipulate the data and provide services to clients.
  • The Data components of a class are called attributes or fields.
  • The operation components of a class are called methods.

Introduction to Object-Oriented Analysis and Design (OOAD)

OOAD: is a software engineering approach that models a system as a group of interacting objects. Each object represents some entity of interest in the system being modeled, and is characterized by its class, its state (data elements), and its behavior. Various models can be created to show the static structure, dynamic behavior, and run-time deployment of these collaborating objects. There are a number of different notations for representing these models, such as the Unified Modeling Language (UML).

Important Definitions

Syntax: The syntax of a programming language specifies the rules for creating a proper application in that language.

Syntax Error: Occurs when the compiler encounters code that violates the programming language rules. Syntax errors are also called compiler errors, compile-time errors or compilation errors.

Using: A using directive tells the compiler where to look for a class that is used in an application.

Namespaces: Predefined classes that can be reused are organized under namespaces. .NET namespaces are referred to as the .NET Framework Class Library.  (http://msdn.microsoft.com/en-us/library/ms229335)

Class Declaration: Every application consists of at least one class declaration that is defined by the programmer. Know as User-Defined Classes.

[note_box]C# is case sensitive. [/note_box]

ex. public class Welcome

Variable: Is a location in the computer’s memory where a value can be stored for use later in an application. ( Variables are typically declared with a name and a type before they are used.)

  • A variable’s name enables the application to access the value of the variable in memory.
  • A variable’s type specifies what kind of information is stored at the location in memory.
  • Every variable has a name, a type, a size and a value.

ex. int number1; is a variable declaration statement. aka declaration. (See Below)

 

Expressions: Any portion of a statement that has a value associated with it.

[titled_color_box title=”To Be Continued…”]

This ends my first session of Visual C# Notes. The next part begins with Arithmetic Calculations..

[/titled_color_box]

You Might Also Like

No Comments

    Leave a Reply