1 / 18

CIS162AD - C#

CIS162AD - C#. Introduction 01_intro.ppt. Introduction to C#. Programming C# History (brief) Compiling Process Categories of Programming Errors. Programming. Program – a set of detailed, step-by-step instructions that directs the computer to process data into information.

judith
Download Presentation

CIS162AD - C#

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CIS162AD - C# Introduction01_intro.ppt

  2. Introduction to C# • Programming • C# History (brief) • Compiling Process • Categories of Programming Errors

  3. Programming • Program – a set of detailed, step-by-step instructions that directs the computer to process data into information. • Programming is combination of art and science, because you may code a program however you like as long as you follow the language’s rules. • Programming language – a set of rules (syntax) and commands that provides a way of telling the computer what operations to perform. • Programmer – designs algorithm and converts it into computer instructions and tests programs as developed.

  4. 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.

  5. 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#.

  6. IDE Software • C# programs are created in a GUI IDE . • GUI : Graphical User Interface • IDE : Integrated Development Environment • C# IDE provides the tools and capabilities to create very powerful and flexible programs. • Can create Forms, Classes, Programs, Database connections, and many other things. • The IDE includes a smart editor, compiler, linker, and debugger.

  7. C# Form

  8. C# Methods

  9. Key Elements of a C# Program • Design the forms (user interface). • Design the methods that will be executed. • Create forms using various control objects. • Write methods that react to object events. • Each statement must end with a semi-colon. • Most blocks of code required an open and close brace { }. private void calculateButton_Click(…) { int intQuanity; decimal decPrice; }

  10. 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…

  11. 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.

  12. Compiling IDE Editor CS1.cs Syntax Errors Warnings Compiler Library Objects Microsoft Intermediate Language (MSIL) Common Language Runtime (CLR) CS1.exein memory

  13. 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).

  14. Three Categories of Errors • Syntax Errors and Warnings • Logic Errors • Run-time Errors • Actually are logic errors.

  15. Syntax Errors & Warnings • Detected by compiler. • Violation of grammar rules. • Mistyped command. • Compiler tells you what the error is or what it thinks it is. • Compiler tries to tell you where the error occurred. • Warnings • Passes syntax rules but not normally coded this way. • Programmer should check for possible logic error.

  16. 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.

  17. 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.

  18. Summary • Software Development Life Cycle (SDLC) • # History • Compiling Process • Categories of Errors

More Related