1 / 34

Emerging Computing

Learn to develop applications using Visual Studio 2005 and C# with an overview of software engineering, .NET Framework, and object-oriented programming concepts.

bernitaj
Download Presentation

Emerging Computing

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. Emerging Computing Unit-3: Introduction to MS Visual Studio and C# M. Abu Baker Siddique

  2. Course Outlines • Introduction to problem solving • Introduction to software engineering • Overview of .NET Framework & Methods • Overview of Visual Studio 2005 • Introduction to C# • Classes & OOP • Software Requirements • Requirements Engineering Processes • Rapid Application Development • Forms & Controls • Software Testing • Verification and validation

  3. Visual Studio • Visual Studio 2005 (VS 2005) is an integrated IDE enabling development of C++, C#, and Visual Basic and J #applications under one roof • It includes numerous features that help in building windows applications with less effort • First, let's start our VS.Net 2005 IDE

  4. Hello World application. • Click 'File > New > Project' from the menu bar. • The following dialog box will appear.

  5. Hello World application. • For this course, projects must be implemented as a C#  application. To start building a C# Console Application follow the following steps. O • n the category column on the left select 'Visual C#  > Windows'. Next, choose 'Console Application' and type 'IntroApp' as your project name. • Also, choose a location to save your application

  6. Hello World application. • Click 'OK'. Another dialog will appear. • One can specify additional settings through this dialog, however for this simple application simply accept the default settings by clicking 'Finish'

  7. Hello World application. • An application developed in VS.Net 2005 is organized into a hierarchy: solution, project and files. • A solution contains one or more project(s); • a project contains one or more file(s). Most files are either source files (.cs) or other reference files. • Double-click the main source file of our IntroApp project (i.e. Program.cs) in the Solution Explorer to view its content in the Code Editing window.

  8. Hello World application. • To build the application press F6, alternatively click the Build Solution () toolbar. • To run the application press F5, alternatively click the Start toolbar (). • When the application is run, the following console will appear.

  9. Hello World application.

  10. Introduction to C# • C# is a : • Simple • Modern • general-purpose, • object-oriented programming language developed by Microsoft within its .NET initiative led by Anders Hejlsberg.

  11. Hello World Application using System; class HelloWorld { static void Main( ) { /* my first program in C# */ Console.WriteLine("Hello World"); Console.ReadKey(); } } }

  12. C# - Overview • C# is a : • Simple • Modern • general-purpose, • object-oriented • Developed by Microsoft • Approved by European Computer Manufacturers Association (ECMA) and International Standards Organization (ISO).

  13. C# - Overview • C# was developed by Anders Hejlsberg and his team during the development of .NetFramework • C# is designed for Common Language Infrastructure (CLI), which consists of the executable code and runtime environment that allows use of various high-level languages on different computer platforms and architectures.

  14. C# - Overview • The following reasons make C# a widely used professional language: • It is a modern, general-purpose programming language • It is object oriented. • It is easy to learn. • It is a structured language. • It produces efficient programs. • It can be compiled on a variety of computer platforms. • It is a part of .Net Framework.

  15. C# - Program Structure • Creating Hello World Program, a C# program consists of the following parts: • Namespace declaration • A class • Class methods • Class attributes • A Main method • Statements and Expressions • Comments

  16. Hello World Application using System; class HelloWorld { static void Main( ) { /* my first program in C# */ Console.WriteLine("Hello World"); Console.ReadKey(); } }

  17. C# - Program Structure • When this code is compiled and executed, it produces the following result: Hello World

  18. C# - Program Structure • The first line of the program using System; - the using keyword is used to include the System namespace in the program. A program generally has multiple using statements. • In general, a namespace uniquely identifies a set of names so that there is no ambiguity when objects having different origins but the same names are mixed together

  19. C# - Program Structure System.Console.WriteLine("Hello World!"); • System is a namespace and Console is a class in that namespace. • Theusing keyword can be used so that the complete name is not required, as in the following example: using System;

  20. C# - Program Structure • The next line has a class declaration, the class Hello World contains the data and method definitions that your program uses. Classes generally contain multiple methods. • Methods define the behavior of the class. • However, the Hello World class has only one method Main.

  21. C# - Program Structure • The next line defines the Main method, which is the entry point for all C# programs. • TheMain method states what the class does when executed.

  22. C# - Program Structure • The next line defines the Main method, which is the entry point for all C# programs. • TheMain method states what the class does when executed.

  23. C# - Program Structure • The next line /*...*/ is ignored by the compiler and it is put to add comments in the program

  24. C# - Program Structure • The next line /*...*/ is ignored by the compiler and it is put to add comments in the program

  25. C# - Program Structure • The Main method specifies its behavior with the statement Console.WriteLine("Hello World"); • WriteLine is a method of the Console class defined in the System namespace. • This statement causes the message "Hello, World!" to be displayed on the screen.

  26. C# - Program Structure • The last line Console.ReadKey(); is for the VS.NET Users. • This makes the program wait for a key press and it prevents the screen from running and closing quickly when the program is launched from Visual Studio .NET

  27. C# - Program Structure • Important Note • C# is case sensitive. • All statements and expression must end with a semicolon (;). • The program execution starts at the Main method. • Unlike Java, program file name could be different from the class name.

More Related