Nothing Special   »   [go: up one dir, main page]

Apt-W1 2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Visual Programming

Yasser N. Mohammed
Introduction Of Programming Language

• The work of programming is to control the work of the computer on all


levels. This is done with the help of "orders" and "commands" from the
programmer also known as programming instructions.

• “Program" means organize the work of the computer through sequences


of instructions. These commands (instructions) are given in written form
by the computer (respectively by the operating system, the CPU and the
peripheral devices).

• Programmers are the people who create these instructions, which control
computers, these instructions are called programs.

2
• C# is a modern, general-purpose, object-oriented programming language
developed by Microsoft and approved by European Computer
Manufacturers Association (ECMA) and International Standards
Organization (ISO).

• C# was developed by Anders Hejlsberg and his team during the


development of .NET Framework and It’s came out around the year 2000.

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

3
The Advantages of C #
• It is a modern, general-purpose programming language.

• It is object oriented.

• It is component 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.


4
The .NET Framework
• The .NET framework is a big platform that helps you to write the following
types of applications:

• Windows applications.
• Web applications.
• Web services.

• The .NET framework applications are multi-platform applications. The


framework has been designed in such a way that it can be used from any
of the following languages: C#, C++, Visual Basic, Jscript, COBOL, etc. All
these languages can access the framework as well as communicate with
each other.

5
A C# program consists of the following parts:
• Namespace declaration.

• A class.

• Class methods.

• Class attributes.

• A Main method.

• Statements and Expressions.

• Comments.

6
Simple code that prints the words "Hello World":

7
The various parts of the given program:

• The first line of the program using System; - the using keyword is used to
include the System namespace in the program.

• A namespace is a collection of classes.

• a class contains the data and method definitions that your program uses,
the class has only one method Main.

• the Main method, which is the entry point for all C# programs. The Main
method states what the class does when executed.

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

8
It is important to note the following points:

• C# is case sensitive. (Capital and Small Letters)

• All statements and expression must end with a semicolon (;).

• The program execution starts at the Main method.

• The using Keyword The first statement in any C# program is


using system.

9
Compiling and Executing the Program
• Start Visual Studio.

• On the menu bar, choose File -> New -> Project.

• Choose Visual C# from templates, and then choose Windows.

• Choose Console Application.

• Specify a name for your project and click OK button. This creates a new
project in Solution Explorer.

• Write code in the Code Editor.

• Click the Run button or press F5 key to execute the project. A Command
Prompt window appears that contains the results.
10

You might also like