SlideShare a Scribd company logo
Introduction toIntroduction to
ProgrammingProgramming
Creating and RunningYour First C# ProgramCreating and RunningYour First C# Program
Svetlin NakovSvetlin Nakov
Telerik CorporationTelerik Corporation
www.telerik.comwww.telerik.com
Table of ContentsTable of Contents
1.1. What is Computer Programming?What is Computer Programming?
2.2. Your First C# ProgramYour First C# Program
3.3. What is .NET Framework?What is .NET Framework?
4.4. What is Visual Studio?What is Visual Studio?
5.5. What is MSDN Library?What is MSDN Library?
2
What is ComputerWhat is Computer
Programming?Programming?
Define: Computer ProgrammingDefine: Computer Programming
Computer programmingComputer programming: creating a: creating a
sequence of instructions to enable thesequence of instructions to enable the
computer to do somethingcomputer to do something
Definition by GoogleDefinition by Google
4
Programming PhasesProgramming Phases
 Define a task/problemDefine a task/problem
 Plan your solutionPlan your solution
Find suitable algorithm to solve itFind suitable algorithm to solve it
Find suitable data structures to useFind suitable data structures to use
 Write codeWrite code
 Fix program error (bugs)Fix program error (bugs)
 Make your customer happyMake your customer happy
= Specification= Specification
= Design= Design
= Implementation= Implementation
= Testing & Debugging= Testing & Debugging
= Deployment= Deployment
5
Your First C# ProgramYour First C# Program
First Look at C#First Look at C#
Sample C# program:Sample C# program:
using System;using System;
class HelloCSharpclass HelloCSharp
{{
static void Main()static void Main()
{{
Console.WriteLine("Hello, C#");Console.WriteLine("Hello, C#");
}}
}}
77
C# Code – How It Works?C# Code – How It Works?
using System;using System;
class HelloCSharpclass HelloCSharp
{{
static void Main()static void Main()
{{
Console.WriteLine("Hello, C#");Console.WriteLine("Hello, C#");
}}
}}
Include the standardInclude the standard
namespace "namespace "SystemSystem""
Define a class calledDefine a class called
""HelloCSharpHelloCSharp""
DefineDefine thethe Main()Main()
method – themethod – the
program entryprogram entry
pointpoint
Print a text on the console byPrint a text on the console by
calling the methodcalling the method
""WriteLineWriteLine" of the class" of the class
""ConsoleConsole"" 8
C# Code Should Be WellC# Code Should Be Well
FormattedFormatted
using System;using System;
class HelloCSharpclass HelloCSharp
{{
static void Main()static void Main()
{{
Console.WriteLine("Hello, C#");Console.WriteLine("Hello, C#");
}}
}}
TheThe {{ symbol shouldsymbol should
be alone on a newbe alone on a new
line.line.
The block after theThe block after the
{{ symbol shouldsymbol should
be indented by abe indented by a
TABTAB..
TheThe }} symbolsymbol
should be under theshould be under the
correspondingcorresponding {{..
Class names should useClass names should use
PascalCasePascalCase and start with aand start with a
CAPITALCAPITAL letter.letter.
9
Example of Bad FormattingExample of Bad Formatting
usingusing
SystemSystem
;;
class HelloCSharp {class HelloCSharp {
staticstatic
void Main( ) { Consolevoid Main( ) { Console
. WriteLine ("Hello, C#" ). WriteLine ("Hello, C#" )
;Console.;Console.
WriteLine ( "Hello again"WriteLine ( "Hello again"
) ;}}) ;}}
Such formattingSuch formatting
makes themakes the
source codesource code
unreadable.unreadable.
10
What is "C#"?What is "C#"?
 Programming languageProgramming language
 A syntax that allow to give instructions to theA syntax that allow to give instructions to the
computercomputer
 C# features:C# features:
 New cutting edge languageNew cutting edge language
 Extremely powerfulExtremely powerful
 Easy to learnEasy to learn
 Easy to read and understandEasy to read and understand
 Object-orientedObject-oriented
11
What You Need to Program?What You Need to Program?
 Knowledge of a programming languageKnowledge of a programming language
C#C#
 Task to solveTask to solve
 Development environment, compilers, SDKDevelopment environment, compilers, SDK
Visual StudioVisual Studio,, .NET Framework SDK.NET Framework SDK
 Set of useful standard classesSet of useful standard classes
Microsoft .NET Framework FCLMicrosoft .NET Framework FCL
 Help documentationHelp documentation
MSDN LibraryMSDN Library
12
Your First C# ProgramYour First C# Program
Live DemoLive Demo
What is .NETWhat is .NET
Framework?Framework?
What is .NET Framework?What is .NET Framework?
 Environment for execution of .NET programsEnvironment for execution of .NET programs
 Powerful library of classesPowerful library of classes
 Programming modelProgramming model
 Common execution engine for manyCommon execution engine for many
programming languagesprogramming languages
C#C#
Visual Basic .NETVisual Basic .NET
Managed C++Managed C++
... and many others... and many others
15
Operating System (OS)Operating System (OS)
Common Language Runtime (CLR)Common Language Runtime (CLR)
Base Class Library (BCL)Base Class Library (BCL)
ADO.NET, LINQ and XML (Data Tier)ADO.NET, LINQ and XML (Data Tier)
WCF and WWF (Communication and Workflow Tier)WCF and WWF (Communication and Workflow Tier)
ASP.NETASP.NET
Web Forms, MVC, AJAXWeb Forms, MVC, AJAX
Mobile Internet ToolkitMobile Internet Toolkit
WindowsWindows
FormsForms
WPFWPF SilverlightSilverlight
C#C# C++C++ VB.NETVB.NET J#J# F#F# JScriptJScript PerlPerl DelphiDelphi ……
Inside .NET FrameworkInside .NET Framework
 Building blocks of .NET FrameworkBuilding blocks of .NET Framework
FCLFCL
CLRCLR
16
CLR – The Heart of .NETCLR – The Heart of .NET
FrameworkFramework
 Common Language Runtime (CLR)Common Language Runtime (CLR)
Managed execution environmentManaged execution environment
 Executes .NET applicationsExecutes .NET applications
 Controls the execution processControls the execution process
Automatic memory managementAutomatic memory management ((garbagegarbage
collectioncollection))
Programming languages integrationProgramming languages integration
Multiple versions support for assembliesMultiple versions support for assemblies
Integrated type safety and securityIntegrated type safety and security
CLRCLR
17
Framework Class LibraryFramework Class Library
 Framework Class Library (FCL)Framework Class Library (FCL)
Provides basic functionality to developers:Provides basic functionality to developers:
 Console applicationsConsole applications
 WPF and Silverlight rich-media applicationsWPF and Silverlight rich-media applications
 Windows Forms GUI applicationsWindows Forms GUI applications
 Web applications (dynamic Web sites)Web applications (dynamic Web sites)
 Web servicesWeb services,, communication and workflowcommunication and workflow
 Server & desktop applicationsServer & desktop applications
 Applications for mobile devicesApplications for mobile devices
18
What isVisual Studio?What isVisual Studio?
Visual StudioVisual Studio
 Visual Studio – Integrated DevelopmentVisual Studio – Integrated Development
Environment (IDE)Environment (IDE)
 Development tool that helps us to:Development tool that helps us to:
Write codeWrite code
Design user interfaceDesign user interface
Compile codeCompile code
Execute / test / debug applicationsExecute / test / debug applications
Browse the helpBrowse the help
Manage project's filesManage project's files
20
Benefits of Visual StudioBenefits of Visual Studio
 Single tool for:Single tool for:
Writing code in many languages (C#, VB, …)Writing code in many languages (C#, VB, …)
Using different technologies (Web, WPF, …)Using different technologies (Web, WPF, …)
For different platforms (.NET CF, Silverlight, …)For different platforms (.NET CF, Silverlight, …)
 Full integration of most development activitiesFull integration of most development activities
(coding, compiling, testing, debugging,(coding, compiling, testing, debugging,
deployment, version control, ...)deployment, version control, ...)
 Very easy to use!Very easy to use!
21
Visual Studio – ExampleVisual Studio – Example
22
Visual StudioVisual Studio
Compiling, Running and Debugging C# ProgramsCompiling, Running and Debugging C# Programs
Creating New Console ApplicationCreating New Console Application
1.1. FileFile  NewNew  Project ...Project ...
2.2. Choose C# console applicationChoose C# console application
3.3. Choose project directory and nameChoose project directory and name
24
Creating New Console Application (2)Creating New Console Application (2)
4.4. Visual Studio creates some source code for youVisual Studio creates some source code for you
NamespaceNamespace
not requirednot required
Class nameClass name
should beshould be
changedchanged
Some importsSome imports
are not requiredare not required
25
Compiling Source CodeCompiling Source Code
 The process ofThe process of compilingcompiling includes:includes:
Syntactic checksSyntactic checks
Type safety checksType safety checks
Translation of the source code to lower levelTranslation of the source code to lower level
language (MSIL)language (MSIL)
Creating of executable files (assemblies)Creating of executable files (assemblies)
 You can start compilation byYou can start compilation by
UsingUsing Build->Build Solution/ProjectBuild->Build Solution/Project
PressingPressing [[F6]F6] oror [Shift+Ctrl+B][Shift+Ctrl+B]
26
Running ProgramsRunning Programs
 The process ofThe process of runningrunning application includes:application includes:
Compiling (if project not compiled)Compiling (if project not compiled)
Starting the applicationStarting the application
 You can run application by:You can run application by:
UsingUsing Debug->StartDebug->Start menumenu
By pressingBy pressing [F5][F5] oror [Ctrl+F5][Ctrl+F5]
* NOTE: Not all types of projects are able to be* NOTE: Not all types of projects are able to be
started!started!
27
Debugging The CodeDebugging The Code
 The process ofThe process of debuggingdebugging
application includes:application includes:
Spotting an errorSpotting an error
Finding the lines of code thatFinding the lines of code that
cause the errorcause the error
Fixing the codeFixing the code
Testing to check if the error isTesting to check if the error is
gone and no errors are introducedgone and no errors are introduced
 Iterative and continuous processIterative and continuous process
28
Debugging in Visual StudioDebugging in Visual Studio
 Visual Studio has built-in debuggerVisual Studio has built-in debugger
 It provides:It provides:
BreakpointsBreakpoints
Ability to trace the code executionAbility to trace the code execution
Ability to inspect variables at runtimeAbility to inspect variables at runtime
29
Visual StudioVisual Studio
Compiling, Running and Debugging C# ProgramsCompiling, Running and Debugging C# Programs
LiveLive DemoDemo
What is MSDNWhat is MSDN
Library?Library?
What is MSDN Library?What is MSDN Library?
 Complete documentation of all classes andComplete documentation of all classes and
their functionalitytheir functionality
With descriptions of all methods, properties,With descriptions of all methods, properties,
events, etc.events, etc.
With code examplesWith code examples
 Related articlesRelated articles
 Library of samplesLibrary of samples
 Use local copy or the Web version atUse local copy or the Web version at http://http://
msdn.microsoft.com/msdn.microsoft.com/
32
MSDN LibraryMSDN Library
33
How to Use MSDN Library?How to Use MSDN Library?
 Offline versionOffline version
Use the table of contentsUse the table of contents
Use the alphabetical indexUse the alphabetical index
Search for phrase or keywordSearch for phrase or keyword
Filter by technologyFilter by technology
Browse your favorite articlesBrowse your favorite articles
 Online versionOnline version
Use the built-in searchUse the built-in search
34
MSDN LibraryMSDN Library
Browsing and Searching DocumentationBrowsing and Searching Documentation
Live DemoLive Demo
Introduction to ProgrammingIntroduction to Programming
Questions?Questions?
http://academy.telerik.com
ExercisesExercises
1.1. Familiarize yourself with:Familiarize yourself with:
 Microsoft Visual StudioMicrosoft Visual Studio
 Microsoft Developer Network (MSDN) LibraryMicrosoft Developer Network (MSDN) Library
DocumentationDocumentation
 Find information aboutFind information about Console.WriteLine()Console.WriteLine() method.method.
1.1. Create, compile and run a “Hello C#” consoleCreate, compile and run a “Hello C#” console
application.application.
2.2. Modify the application to print your name.Modify the application to print your name.
3.3. Write a program to print the numbers 1, 101 andWrite a program to print the numbers 1, 101 and
1001.1001.
37
Exercises (2)Exercises (2)
5.5. Install at home:Install at home:
1.1. Microsoft .NET FrameworkMicrosoft .NET Framework
2.2. Microsoft Visual Studio (or Visual C# Express)Microsoft Visual Studio (or Visual C# Express)
3.3. Microsoft Developer Network (MSDN)Microsoft Developer Network (MSDN)
6.6. Create console application that prints your first andCreate console application that prints your first and
last name.last name.
7.7. Create a console application that prints the currentCreate a console application that prints the current
date and time.date and time.
8.8. Create a console application that calculates andCreate a console application that calculates and
prints the square of the number 12345.prints the square of the number 12345.
38
Exercises (3)Exercises (3)
9.9. Write a program that prints the first 10 members ofWrite a program that prints the first 10 members of
the sequence: 2, -3, 4, -5, 6, -7, ...the sequence: 2, -3, 4, -5, 6, -7, ...
10.10. Provide a short list with information about the mostProvide a short list with information about the most
popular programming languages. How do they differpopular programming languages. How do they differ
from C#?from C#?
11.11. Describe the difference between C# and .NETDescribe the difference between C# and .NET
Framework.Framework.
12.12. * Write a program to read your age from the console* Write a program to read your age from the console
and print how old you will be after 10 years.and print how old you will be after 10 years.
*NOTE: If you have any difficulties, search in Google.*NOTE: If you have any difficulties, search in Google.
39
Ad

More Related Content

What's hot (20)

PHP, Java EE & .NET Comparison
PHP, Java EE & .NET ComparisonPHP, Java EE & .NET Comparison
PHP, Java EE & .NET Comparison
Haim Michael
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
Jayanta Basak
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
Ravi Jakashania
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
Kamlesh Makvana
 
Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Overview of .Net Framework 4.5
Overview of .Net Framework 4.5
Bhushan Mulmule
 
Dotnet framework
Dotnet frameworkDotnet framework
Dotnet framework
Nitu Pandey
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
HEM Sothon
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
Revanth Mca
 
T4 presentation
T4 presentationT4 presentation
T4 presentation
Gary Pedretti
 
C++ in Windows Phone Apps - Overview
C++ in Windows Phone Apps - OverviewC++ in Windows Phone Apps - Overview
C++ in Windows Phone Apps - Overview
Mirco Vanini
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
Maarten Balliauw
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_days
Ankit Dubey
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
Nethaji Naidu
 
Electron
ElectronElectron
Electron
Mark Lechtermann
 
Unit i
Unit iUnit i
Unit i
vijay gupta
 
New Year PVS-Studio 6.00 Release: Scanning Roslyn
New Year PVS-Studio 6.00 Release: Scanning RoslynNew Year PVS-Studio 6.00 Release: Scanning Roslyn
New Year PVS-Studio 6.00 Release: Scanning Roslyn
PVS-Studio
 
resume
resumeresume
resume
Srinivasa Rao M
 
Programming with c#
Programming with c#Programming with c#
Programming with c#
Luis Goldster
 
C# tutorial
C# tutorialC# tutorial
C# tutorial
sarangowtham_gunnam
 
Nakov dot net-framework-overview-english
Nakov dot net-framework-overview-englishNakov dot net-framework-overview-english
Nakov dot net-framework-overview-english
srivathsan.10
 
PHP, Java EE & .NET Comparison
PHP, Java EE & .NET ComparisonPHP, Java EE & .NET Comparison
PHP, Java EE & .NET Comparison
Haim Michael
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
Jayanta Basak
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
Kamlesh Makvana
 
Overview of .Net Framework 4.5
Overview of .Net Framework 4.5Overview of .Net Framework 4.5
Overview of .Net Framework 4.5
Bhushan Mulmule
 
Dotnet framework
Dotnet frameworkDotnet framework
Dotnet framework
Nitu Pandey
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
HEM Sothon
 
C++ in Windows Phone Apps - Overview
C++ in Windows Phone Apps - OverviewC++ in Windows Phone Apps - Overview
C++ in Windows Phone Apps - Overview
Mirco Vanini
 
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
Maarten Balliauw
 
Programming in c_in_7_days
Programming in c_in_7_daysProgramming in c_in_7_days
Programming in c_in_7_days
Ankit Dubey
 
The seven pillars of aspnet
The seven pillars of aspnetThe seven pillars of aspnet
The seven pillars of aspnet
Nethaji Naidu
 
New Year PVS-Studio 6.00 Release: Scanning Roslyn
New Year PVS-Studio 6.00 Release: Scanning RoslynNew Year PVS-Studio 6.00 Release: Scanning Roslyn
New Year PVS-Studio 6.00 Release: Scanning Roslyn
PVS-Studio
 
Nakov dot net-framework-overview-english
Nakov dot net-framework-overview-englishNakov dot net-framework-overview-english
Nakov dot net-framework-overview-english
srivathsan.10
 

Similar to 01 Introduction to programming (20)

LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptx
AOmaAli
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to Programming
Intro C# Book
 
Lecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkLecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net framework
AbdullahNadeem78
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
WE-IT TUTORIALS
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp En
Gregory Renard
 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
Mir Majid
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
Ramesh Prasad
 
.NET Overview
.NET Overview.NET Overview
.NET Overview
Greg Sohl
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1
Sisir Ghosh
 
1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)
Shoaib Ghachi
 
T2
T2T2
T2
lksoo
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
Ekam Baram
 
Intro to .NET and Core C#
Intro to .NET and Core C#Intro to .NET and Core C#
Intro to .NET and Core C#
Jussi Pohjolainen
 
SynapseIndia dotnet development framework
SynapseIndia  dotnet development frameworkSynapseIndia  dotnet development framework
SynapseIndia dotnet development framework
Synapseindiappsdevelopment
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
OpenSource Technologies Pvt. Ltd.
 
.Net framework
.Net framework.Net framework
.Net framework
Raghu nath
 
The Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.NetThe Seven Pillars Of Asp.Net
The Seven Pillars Of Asp.Net
Anand Kumar Rajana
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
AnassElHousni
 
C in7-days
C in7-daysC in7-days
C in7-days
Sanuj Nair
 
C in7-days
C in7-daysC in7-days
C in7-days
Amit Kapoor
 
LECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptxLECTURE 1 - Introduction to Programming.pptx
LECTURE 1 - Introduction to Programming.pptx
AOmaAli
 
01. Introduction to Programming
01. Introduction to Programming01. Introduction to Programming
01. Introduction to Programming
Intro C# Book
 
Lecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net frameworkLecture-1&2.pdf Visual Programming C# .net framework
Lecture-1&2.pdf Visual Programming C# .net framework
AbdullahNadeem78
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
WE-IT TUTORIALS
 
Introdot Netc Sharp En
Introdot Netc Sharp EnIntrodot Netc Sharp En
Introdot Netc Sharp En
Gregory Renard
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
Ramesh Prasad
 
.NET Overview
.NET Overview.NET Overview
.NET Overview
Greg Sohl
 
ASP.NET Session 1
ASP.NET Session 1ASP.NET Session 1
ASP.NET Session 1
Sisir Ghosh
 
1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)1..Net Framework Architecture-(c#)
1..Net Framework Architecture-(c#)
Shoaib Ghachi
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
Ekam Baram
 
.Net framework
.Net framework.Net framework
.Net framework
Raghu nath
 
Introduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdfIntroduction-to-C-Part-1.pdf
Introduction-to-C-Part-1.pdf
AnassElHousni
 
Ad

More from maznabili (20)

22 Methodology of problem solving
22 Methodology of problem solving22 Methodology of problem solving
22 Methodology of problem solving
maznabili
 
21 High-quality programming code construction part-ii
21 High-quality programming code construction part-ii21 High-quality programming code construction part-ii
21 High-quality programming code construction part-ii
maznabili
 
21 high-quality programming code construction part-i
21 high-quality programming code construction part-i21 high-quality programming code construction part-i
21 high-quality programming code construction part-i
maznabili
 
20 Object-oriented programming principles
20 Object-oriented programming principles20 Object-oriented programming principles
20 Object-oriented programming principles
maznabili
 
19 Algorithms and complexity
19 Algorithms and complexity19 Algorithms and complexity
19 Algorithms and complexity
maznabili
 
18 Hash tables and sets
18 Hash tables and sets18 Hash tables and sets
18 Hash tables and sets
maznabili
 
17 Trees and graphs
17 Trees and graphs17 Trees and graphs
17 Trees and graphs
maznabili
 
16 Linear data structures
16 Linear data structures16 Linear data structures
16 Linear data structures
maznabili
 
15 Text files
15 Text files15 Text files
15 Text files
maznabili
 
14 Defining classes
14 Defining classes14 Defining classes
14 Defining classes
maznabili
 
13 Strings and text processing
13 Strings and text processing13 Strings and text processing
13 Strings and text processing
maznabili
 
12 Exceptions handling
12 Exceptions handling12 Exceptions handling
12 Exceptions handling
maznabili
 
11 Using classes and objects
11 Using classes and objects11 Using classes and objects
11 Using classes and objects
maznabili
 
10 Recursion
10 Recursion10 Recursion
10 Recursion
maznabili
 
09 Methods
09 Methods09 Methods
09 Methods
maznabili
 
08 Numeral systems
08 Numeral systems08 Numeral systems
08 Numeral systems
maznabili
 
07 Arrays
07 Arrays07 Arrays
07 Arrays
maznabili
 
06 Loops
06 Loops06 Loops
06 Loops
maznabili
 
05 Conditional statements
05 Conditional statements05 Conditional statements
05 Conditional statements
maznabili
 
04 Console input output-
04 Console input output-04 Console input output-
04 Console input output-
maznabili
 
22 Methodology of problem solving
22 Methodology of problem solving22 Methodology of problem solving
22 Methodology of problem solving
maznabili
 
21 High-quality programming code construction part-ii
21 High-quality programming code construction part-ii21 High-quality programming code construction part-ii
21 High-quality programming code construction part-ii
maznabili
 
21 high-quality programming code construction part-i
21 high-quality programming code construction part-i21 high-quality programming code construction part-i
21 high-quality programming code construction part-i
maznabili
 
20 Object-oriented programming principles
20 Object-oriented programming principles20 Object-oriented programming principles
20 Object-oriented programming principles
maznabili
 
19 Algorithms and complexity
19 Algorithms and complexity19 Algorithms and complexity
19 Algorithms and complexity
maznabili
 
18 Hash tables and sets
18 Hash tables and sets18 Hash tables and sets
18 Hash tables and sets
maznabili
 
17 Trees and graphs
17 Trees and graphs17 Trees and graphs
17 Trees and graphs
maznabili
 
16 Linear data structures
16 Linear data structures16 Linear data structures
16 Linear data structures
maznabili
 
15 Text files
15 Text files15 Text files
15 Text files
maznabili
 
14 Defining classes
14 Defining classes14 Defining classes
14 Defining classes
maznabili
 
13 Strings and text processing
13 Strings and text processing13 Strings and text processing
13 Strings and text processing
maznabili
 
12 Exceptions handling
12 Exceptions handling12 Exceptions handling
12 Exceptions handling
maznabili
 
11 Using classes and objects
11 Using classes and objects11 Using classes and objects
11 Using classes and objects
maznabili
 
10 Recursion
10 Recursion10 Recursion
10 Recursion
maznabili
 
08 Numeral systems
08 Numeral systems08 Numeral systems
08 Numeral systems
maznabili
 
05 Conditional statements
05 Conditional statements05 Conditional statements
05 Conditional statements
maznabili
 
04 Console input output-
04 Console input output-04 Console input output-
04 Console input output-
maznabili
 
Ad

Recently uploaded (20)

Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 

01 Introduction to programming

  • 1. Introduction toIntroduction to ProgrammingProgramming Creating and RunningYour First C# ProgramCreating and RunningYour First C# Program Svetlin NakovSvetlin Nakov Telerik CorporationTelerik Corporation www.telerik.comwww.telerik.com
  • 2. Table of ContentsTable of Contents 1.1. What is Computer Programming?What is Computer Programming? 2.2. Your First C# ProgramYour First C# Program 3.3. What is .NET Framework?What is .NET Framework? 4.4. What is Visual Studio?What is Visual Studio? 5.5. What is MSDN Library?What is MSDN Library? 2
  • 3. What is ComputerWhat is Computer Programming?Programming?
  • 4. Define: Computer ProgrammingDefine: Computer Programming Computer programmingComputer programming: creating a: creating a sequence of instructions to enable thesequence of instructions to enable the computer to do somethingcomputer to do something Definition by GoogleDefinition by Google 4
  • 5. Programming PhasesProgramming Phases  Define a task/problemDefine a task/problem  Plan your solutionPlan your solution Find suitable algorithm to solve itFind suitable algorithm to solve it Find suitable data structures to useFind suitable data structures to use  Write codeWrite code  Fix program error (bugs)Fix program error (bugs)  Make your customer happyMake your customer happy = Specification= Specification = Design= Design = Implementation= Implementation = Testing & Debugging= Testing & Debugging = Deployment= Deployment 5
  • 6. Your First C# ProgramYour First C# Program
  • 7. First Look at C#First Look at C# Sample C# program:Sample C# program: using System;using System; class HelloCSharpclass HelloCSharp {{ static void Main()static void Main() {{ Console.WriteLine("Hello, C#");Console.WriteLine("Hello, C#"); }} }} 77
  • 8. C# Code – How It Works?C# Code – How It Works? using System;using System; class HelloCSharpclass HelloCSharp {{ static void Main()static void Main() {{ Console.WriteLine("Hello, C#");Console.WriteLine("Hello, C#"); }} }} Include the standardInclude the standard namespace "namespace "SystemSystem"" Define a class calledDefine a class called ""HelloCSharpHelloCSharp"" DefineDefine thethe Main()Main() method – themethod – the program entryprogram entry pointpoint Print a text on the console byPrint a text on the console by calling the methodcalling the method ""WriteLineWriteLine" of the class" of the class ""ConsoleConsole"" 8
  • 9. C# Code Should Be WellC# Code Should Be Well FormattedFormatted using System;using System; class HelloCSharpclass HelloCSharp {{ static void Main()static void Main() {{ Console.WriteLine("Hello, C#");Console.WriteLine("Hello, C#"); }} }} TheThe {{ symbol shouldsymbol should be alone on a newbe alone on a new line.line. The block after theThe block after the {{ symbol shouldsymbol should be indented by abe indented by a TABTAB.. TheThe }} symbolsymbol should be under theshould be under the correspondingcorresponding {{.. Class names should useClass names should use PascalCasePascalCase and start with aand start with a CAPITALCAPITAL letter.letter. 9
  • 10. Example of Bad FormattingExample of Bad Formatting usingusing SystemSystem ;; class HelloCSharp {class HelloCSharp { staticstatic void Main( ) { Consolevoid Main( ) { Console . WriteLine ("Hello, C#" ). WriteLine ("Hello, C#" ) ;Console.;Console. WriteLine ( "Hello again"WriteLine ( "Hello again" ) ;}}) ;}} Such formattingSuch formatting makes themakes the source codesource code unreadable.unreadable. 10
  • 11. What is "C#"?What is "C#"?  Programming languageProgramming language  A syntax that allow to give instructions to theA syntax that allow to give instructions to the computercomputer  C# features:C# features:  New cutting edge languageNew cutting edge language  Extremely powerfulExtremely powerful  Easy to learnEasy to learn  Easy to read and understandEasy to read and understand  Object-orientedObject-oriented 11
  • 12. What You Need to Program?What You Need to Program?  Knowledge of a programming languageKnowledge of a programming language C#C#  Task to solveTask to solve  Development environment, compilers, SDKDevelopment environment, compilers, SDK Visual StudioVisual Studio,, .NET Framework SDK.NET Framework SDK  Set of useful standard classesSet of useful standard classes Microsoft .NET Framework FCLMicrosoft .NET Framework FCL  Help documentationHelp documentation MSDN LibraryMSDN Library 12
  • 13. Your First C# ProgramYour First C# Program Live DemoLive Demo
  • 14. What is .NETWhat is .NET Framework?Framework?
  • 15. What is .NET Framework?What is .NET Framework?  Environment for execution of .NET programsEnvironment for execution of .NET programs  Powerful library of classesPowerful library of classes  Programming modelProgramming model  Common execution engine for manyCommon execution engine for many programming languagesprogramming languages C#C# Visual Basic .NETVisual Basic .NET Managed C++Managed C++ ... and many others... and many others 15
  • 16. Operating System (OS)Operating System (OS) Common Language Runtime (CLR)Common Language Runtime (CLR) Base Class Library (BCL)Base Class Library (BCL) ADO.NET, LINQ and XML (Data Tier)ADO.NET, LINQ and XML (Data Tier) WCF and WWF (Communication and Workflow Tier)WCF and WWF (Communication and Workflow Tier) ASP.NETASP.NET Web Forms, MVC, AJAXWeb Forms, MVC, AJAX Mobile Internet ToolkitMobile Internet Toolkit WindowsWindows FormsForms WPFWPF SilverlightSilverlight C#C# C++C++ VB.NETVB.NET J#J# F#F# JScriptJScript PerlPerl DelphiDelphi …… Inside .NET FrameworkInside .NET Framework  Building blocks of .NET FrameworkBuilding blocks of .NET Framework FCLFCL CLRCLR 16
  • 17. CLR – The Heart of .NETCLR – The Heart of .NET FrameworkFramework  Common Language Runtime (CLR)Common Language Runtime (CLR) Managed execution environmentManaged execution environment  Executes .NET applicationsExecutes .NET applications  Controls the execution processControls the execution process Automatic memory managementAutomatic memory management ((garbagegarbage collectioncollection)) Programming languages integrationProgramming languages integration Multiple versions support for assembliesMultiple versions support for assemblies Integrated type safety and securityIntegrated type safety and security CLRCLR 17
  • 18. Framework Class LibraryFramework Class Library  Framework Class Library (FCL)Framework Class Library (FCL) Provides basic functionality to developers:Provides basic functionality to developers:  Console applicationsConsole applications  WPF and Silverlight rich-media applicationsWPF and Silverlight rich-media applications  Windows Forms GUI applicationsWindows Forms GUI applications  Web applications (dynamic Web sites)Web applications (dynamic Web sites)  Web servicesWeb services,, communication and workflowcommunication and workflow  Server & desktop applicationsServer & desktop applications  Applications for mobile devicesApplications for mobile devices 18
  • 19. What isVisual Studio?What isVisual Studio?
  • 20. Visual StudioVisual Studio  Visual Studio – Integrated DevelopmentVisual Studio – Integrated Development Environment (IDE)Environment (IDE)  Development tool that helps us to:Development tool that helps us to: Write codeWrite code Design user interfaceDesign user interface Compile codeCompile code Execute / test / debug applicationsExecute / test / debug applications Browse the helpBrowse the help Manage project's filesManage project's files 20
  • 21. Benefits of Visual StudioBenefits of Visual Studio  Single tool for:Single tool for: Writing code in many languages (C#, VB, …)Writing code in many languages (C#, VB, …) Using different technologies (Web, WPF, …)Using different technologies (Web, WPF, …) For different platforms (.NET CF, Silverlight, …)For different platforms (.NET CF, Silverlight, …)  Full integration of most development activitiesFull integration of most development activities (coding, compiling, testing, debugging,(coding, compiling, testing, debugging, deployment, version control, ...)deployment, version control, ...)  Very easy to use!Very easy to use! 21
  • 22. Visual Studio – ExampleVisual Studio – Example 22
  • 23. Visual StudioVisual Studio Compiling, Running and Debugging C# ProgramsCompiling, Running and Debugging C# Programs
  • 24. Creating New Console ApplicationCreating New Console Application 1.1. FileFile  NewNew  Project ...Project ... 2.2. Choose C# console applicationChoose C# console application 3.3. Choose project directory and nameChoose project directory and name 24
  • 25. Creating New Console Application (2)Creating New Console Application (2) 4.4. Visual Studio creates some source code for youVisual Studio creates some source code for you NamespaceNamespace not requirednot required Class nameClass name should beshould be changedchanged Some importsSome imports are not requiredare not required 25
  • 26. Compiling Source CodeCompiling Source Code  The process ofThe process of compilingcompiling includes:includes: Syntactic checksSyntactic checks Type safety checksType safety checks Translation of the source code to lower levelTranslation of the source code to lower level language (MSIL)language (MSIL) Creating of executable files (assemblies)Creating of executable files (assemblies)  You can start compilation byYou can start compilation by UsingUsing Build->Build Solution/ProjectBuild->Build Solution/Project PressingPressing [[F6]F6] oror [Shift+Ctrl+B][Shift+Ctrl+B] 26
  • 27. Running ProgramsRunning Programs  The process ofThe process of runningrunning application includes:application includes: Compiling (if project not compiled)Compiling (if project not compiled) Starting the applicationStarting the application  You can run application by:You can run application by: UsingUsing Debug->StartDebug->Start menumenu By pressingBy pressing [F5][F5] oror [Ctrl+F5][Ctrl+F5] * NOTE: Not all types of projects are able to be* NOTE: Not all types of projects are able to be started!started! 27
  • 28. Debugging The CodeDebugging The Code  The process ofThe process of debuggingdebugging application includes:application includes: Spotting an errorSpotting an error Finding the lines of code thatFinding the lines of code that cause the errorcause the error Fixing the codeFixing the code Testing to check if the error isTesting to check if the error is gone and no errors are introducedgone and no errors are introduced  Iterative and continuous processIterative and continuous process 28
  • 29. Debugging in Visual StudioDebugging in Visual Studio  Visual Studio has built-in debuggerVisual Studio has built-in debugger  It provides:It provides: BreakpointsBreakpoints Ability to trace the code executionAbility to trace the code execution Ability to inspect variables at runtimeAbility to inspect variables at runtime 29
  • 30. Visual StudioVisual Studio Compiling, Running and Debugging C# ProgramsCompiling, Running and Debugging C# Programs LiveLive DemoDemo
  • 31. What is MSDNWhat is MSDN Library?Library?
  • 32. What is MSDN Library?What is MSDN Library?  Complete documentation of all classes andComplete documentation of all classes and their functionalitytheir functionality With descriptions of all methods, properties,With descriptions of all methods, properties, events, etc.events, etc. With code examplesWith code examples  Related articlesRelated articles  Library of samplesLibrary of samples  Use local copy or the Web version atUse local copy or the Web version at http://http:// msdn.microsoft.com/msdn.microsoft.com/ 32
  • 34. How to Use MSDN Library?How to Use MSDN Library?  Offline versionOffline version Use the table of contentsUse the table of contents Use the alphabetical indexUse the alphabetical index Search for phrase or keywordSearch for phrase or keyword Filter by technologyFilter by technology Browse your favorite articlesBrowse your favorite articles  Online versionOnline version Use the built-in searchUse the built-in search 34
  • 35. MSDN LibraryMSDN Library Browsing and Searching DocumentationBrowsing and Searching Documentation Live DemoLive Demo
  • 36. Introduction to ProgrammingIntroduction to Programming Questions?Questions? http://academy.telerik.com
  • 37. ExercisesExercises 1.1. Familiarize yourself with:Familiarize yourself with:  Microsoft Visual StudioMicrosoft Visual Studio  Microsoft Developer Network (MSDN) LibraryMicrosoft Developer Network (MSDN) Library DocumentationDocumentation  Find information aboutFind information about Console.WriteLine()Console.WriteLine() method.method. 1.1. Create, compile and run a “Hello C#” consoleCreate, compile and run a “Hello C#” console application.application. 2.2. Modify the application to print your name.Modify the application to print your name. 3.3. Write a program to print the numbers 1, 101 andWrite a program to print the numbers 1, 101 and 1001.1001. 37
  • 38. Exercises (2)Exercises (2) 5.5. Install at home:Install at home: 1.1. Microsoft .NET FrameworkMicrosoft .NET Framework 2.2. Microsoft Visual Studio (or Visual C# Express)Microsoft Visual Studio (or Visual C# Express) 3.3. Microsoft Developer Network (MSDN)Microsoft Developer Network (MSDN) 6.6. Create console application that prints your first andCreate console application that prints your first and last name.last name. 7.7. Create a console application that prints the currentCreate a console application that prints the current date and time.date and time. 8.8. Create a console application that calculates andCreate a console application that calculates and prints the square of the number 12345.prints the square of the number 12345. 38
  • 39. Exercises (3)Exercises (3) 9.9. Write a program that prints the first 10 members ofWrite a program that prints the first 10 members of the sequence: 2, -3, 4, -5, 6, -7, ...the sequence: 2, -3, 4, -5, 6, -7, ... 10.10. Provide a short list with information about the mostProvide a short list with information about the most popular programming languages. How do they differpopular programming languages. How do they differ from C#?from C#? 11.11. Describe the difference between C# and .NETDescribe the difference between C# and .NET Framework.Framework. 12.12. * Write a program to read your age from the console* Write a program to read your age from the console and print how old you will be after 10 years.and print how old you will be after 10 years. *NOTE: If you have any difficulties, search in Google.*NOTE: If you have any difficulties, search in Google. 39