Introduction - C Sharp Programming - Lecture Slides, Slides of C programming

Some concept of C Sharp Programming are Additional Controls, Declaring Arrays, Call-By-Reference Methods, Information Processing Cycle. Main points of this lecture are: Introduction, Programming, History, Compiling Process, Categories, Programming Errors, Language’S Rules, Computer, Algorithm, Computer Instructions

Typology: Slides

2012/2013

Uploaded on 04/27/2013

farooq
farooq 🇮🇳

4.3

(94)

203 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Introduction
01_intro.ppt
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Introduction - C Sharp Programming - Lecture Slides and more Slides C programming in PDF only on Docsity!

Introduction

01_intro.ppt

Introduction to C#

  • Programming
  • C# History (brief)
  • Compiling Process
  • Categories of Programming Errors

Programming Categories

  • Object-Oriented Programming (OOP)
    • Emphasis is on identifying objects in a problem (student, faculty, etc).
    • Objects are then categorized into classes (person).
    • Classes are used in programs to create and manipulate objects. objCustomer = new clsCustomer;
  • Procedural Programming
    • Emphasis is on identifying the procedures or steps to solve a problem and then creating a program as the solution.
  • Event Programming
    • Usually related to GUI programming.
    • Program reacts to events, such as a user clicking on a mouse.
  • All of these techniques will be used throughout our C#.NET assignments.

History of C#

  • In 2000 Microsoft released the .Net programming platform.
  • Microsoft included it’s new language C# (pronounced C-Sharp).
  • Roots are in C, C++, and Java.
  • .Net includes a rich library of pre-built components that are shared among the .Net languages such as Visual Basic (VB).
  • If you know VB, you should recognize some of the classes and methods that are used in C#.

C# Form

C# Methods

C# to Machine Language

  • C# programs are typed in as text.
  • Programs have a .cs extension.
    • CS1Form.cs
  • Form Resources have a .resx extension.
    • CS1Form.resx
  • Must be converted to machine language.
  • How?
  • By compiling…

Compiler and Linker

  • Compiler
    • Verifies the program is coded with commands it recognizes and that the proper syntax was used.
    • Creates an object file (machine language).
  • Linker
    • Combines the program’s object file with object code of standard routines from the library.
    • Creates the final executable file (.exe).
    • In the .Net Framework, Common Language Runtime (CLR) is the linker.

Syntax

  • There are several languages to choose from.
  • Each language has a set of commands that can

be used.

  • Each language has a set of syntax rules that

must be followed.

  • Syntax determines many things - like how commands are entered and how each command should end (period, semi-colon, etc).

Three Categories of Errors

  • Syntax Errors and Warnings
  • Logic Errors
  • Run-time Errors
    • Actually are logic errors.

Logic Errors

  • Detected and corrected by programmer.
  • Program designed or written incorrectly.
  • Output generated does NOT match expected

output.

  • Simple to very complex.
    • Using * (multiply) instead of + (add)
  • Test, test, test and verify results.
  • This is where programmers earn their money.

Run-time Errors

  • Usually discovered by user, but corrected by programmer.
  • Program terminates unexpectedly.
    • Error: access violation …
  • Usually based on a logic error.
    • Divide by zero
  • Users do something programmer didn’t expect them to do. - Processing unexpected input, such as letters instead of numbers.
  • Users need to document what they were doing when the error occurred to help programmer.