SlideShare a Scribd company logo
1 of 22
XAMARIN MOBILE APPLICATION
DEVELOPMENT COURSE
Portable Class Library (PCL) using C#
Chapter 2
- Basic to C# Programming -
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
What is C# Programming?
C# (pronounced "C-sharp") is an object-oriented programming language from
Microsoft that aims to combine the computing power of C++ with the
programming ease of Visual Basic. C# is based on C++ and contains features
similar to those of Java.
• Object Oriented
• Multi Paradigm
Visual Studio 2015. Updated: July 20, 2015. C# (pronounced "C sharp") is a
programming language that is designed for building a variety of applications
that run on the .NET Framework. C# is simple, powerful, type-safe, and object-
oriented.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Program Structure
Output : Hello World
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Program Structure
Terms Explanation
+ Using
+ Namespace
+ Class
+ Main
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Program Structure
Terms Explanation
+ Using
This command are use to call (include)
another namespace or library.
After this call has been made, all variables,
classes & methods can be accessed by
current program / namespace.
This command also use to access property
from another namespace or properties.
Example are as the above-right.
This command has it’s own code block which is
every code write are only available or active on it’s
own code block.
//open of a code block
//close current code block
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Program Structure
Terms Explanation
+ Namespace
Namespace is a collection of classes.
In other word, we could say namespace is a
name of a program which is contains all
functions/methods, variables and classes of
a current programs.
Namespace has its own code block.
The state codes are only active /
accessible in its current namespace.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Program Structure
Terms Explanation
+ Class
Class is a child code block for a namespace.
It contains methods / functions, variables
and child classes. For two or more classes
in a namespace it called as member class.
Classes has its own property called access
specifier.
For class without access specifier (like the
example ‘class HelloWorld’), automatically
the class is defined as an Internal Class.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Program Structure
Terms Explanation
+ Main
In this example, main is a method /
function. Main method is a method where
program firstly read and run.
Every method has its own type of return
value, method type and access specifier.
The picture shows that static is a type of
method and void is a return value type
Void is use to tell the program that the
current method has no return value.
Static use to define
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Access Specifier
Access specifier is a definition of class, method and variable. This definition are required by
program to define the accessibility to other class and method.
Public Can be access publicly to other class even in other namespace
Private Only can be access in current method, class or namespace
Internal
Can be access within the program that contain its declarations and within the
same assembly
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Data Type
Access specifier is a definition of class, method and variable. This definition are required by
program to define the accessibility to other class and method.
Int Integer, numbers without decimal point
String Text
Bool Boolean, yes or no OR 1 or 0
long Integer that has long values.
Decimal Number with decimal point
Float Number with decimal point
Double Number with decimal point
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Methods
A method is a group of statements that together perform tasks. Every C# program has at least one
class with a method named Main (the default, first read and run by program).
Method code block or Do-Something-Here
REMINDER!
Access specifier are as
mentioned before.
Return type are as Data
Type mentioned before.
“VOID” type are used IF
the method has no value
to return.
Parameter list is where to put the variable from outside of the method to
use it inside the method.
To write parameter, its required to put Data Type and variable name.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Anonymous Methods
Anonymous methods provide a technique to pass a code block as a delegate parameter.
Anonymous methods are the methods without a name, just the body.
You need not specify the return type in an anonymous method; it is inferred from the return
statement inside the method body.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Classes
REMINDER!
Access specifier are as
mentioned before.
Class code block contains classes, methods & variables
A class is a construct that enables you to create your own custom types by
grouping together variables of other types, methods and events. A class is like a
blueprint. It defines the data and behaviour of a type.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Conversion
• String – ToString, string.Format
• Int (16, 32, 64) – ToInt16, ToInt32, ToInt64
• Decimal - ToDecimal
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Decision Making
If Else Else If Else
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Decision Making
Switch Case
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Loops
While Loop
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Loops
For Loop
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Object Oriented Programming
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects",
which may contain data, in the form of fields, often known as attributes; and code, in the form of
procedures, often known as methods.
OOP is a solution to state object programmatically.
Example:
Defining cars programmatically.
The code on the left show how to define “Cars”
programmatically. It’s a list of car’s properties.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Object Oriented Programming
The code on the left show how to create a new
car. In programming, its called new instance.
Use the dot (.) symbol to access object or class
child variables, methods or classes.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Practice Make Perfect
Please create a program to collect contacts information.
In the contact, must have the name, email and phone number.
Please create a program to collect contacts information.
In the contact, must have the name, email and phone number.
TIPS!
• Create a new Contact class with variable
name, email and phone number
• Create new instance for every new
contact.
Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
Thank You
Thank you!
You re ready for next course.

More Related Content

What's hot

Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Abstraction and Encapsulation
Abstraction and EncapsulationAbstraction and Encapsulation
Abstraction and EncapsulationHaris Bin Zahid
 
Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4MOHIT TOMAR
 
NL to OCL via SBVR
NL to OCL via SBVRNL to OCL via SBVR
NL to OCL via SBVRImran Bajwa
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++ shammi mehra
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming ConceptsAbhigyan Singh Yadav
 
OOP in C++
OOP in C++OOP in C++
OOP in C++ppd1961
 
Programming Paradigms Seminar 2
Programming Paradigms Seminar 2 Programming Paradigms Seminar 2
Programming Paradigms Seminar 2 neoxiuting
 
C++ with student management system project
C++ with student management system projectC++ with student management system project
C++ with student management system projectKratik Khandelwal
 
OOPS with C++ | Concepts of OOPS | Introduction
OOPS with C++ | Concepts of OOPS | IntroductionOOPS with C++ | Concepts of OOPS | Introduction
OOPS with C++ | Concepts of OOPS | IntroductionADITYATANDONKECCSE
 
C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1Ali Raza Jilani
 
SKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSkillwise Group
 

What's hot (20)

SEMINAR
SEMINARSEMINAR
SEMINAR
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Abstraction and Encapsulation
Abstraction and EncapsulationAbstraction and Encapsulation
Abstraction and Encapsulation
 
Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4Oops concept in c++ unit 3 -topic 4
Oops concept in c++ unit 3 -topic 4
 
NL to OCL via SBVR
NL to OCL via SBVRNL to OCL via SBVR
NL to OCL via SBVR
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Programming Paradigms Seminar 2
Programming Paradigms Seminar 2 Programming Paradigms Seminar 2
Programming Paradigms Seminar 2
 
General oops concepts
General oops conceptsGeneral oops concepts
General oops concepts
 
C++ with student management system project
C++ with student management system projectC++ with student management system project
C++ with student management system project
 
OOPS with C++ | Concepts of OOPS | Introduction
OOPS with C++ | Concepts of OOPS | IntroductionOOPS with C++ | Concepts of OOPS | Introduction
OOPS with C++ | Concepts of OOPS | Introduction
 
2 Object Oriented Programming
2 Object Oriented Programming2 Object Oriented Programming
2 Object Oriented Programming
 
C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1C++ Basics introduction to typecasting Webinar Slides 1
C++ Basics introduction to typecasting Webinar Slides 1
 
SKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPTSKILLWISE - OOPS CONCEPT
SKILLWISE - OOPS CONCEPT
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
concept of oops
concept of oopsconcept of oops
concept of oops
 

Similar to C# programming : Chapter One

PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptxPROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptxBELMERGLADSONAsstPro
 
PRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxPRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxSajalKesharwani2
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...Make Mannan
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsShanmuganathan C
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]Abhishek Sinha
 
over all view programming to computer
over all view programming to computer over all view programming to computer
over all view programming to computer muniryaseen
 
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfjorgeulises3
 
Programming in c++
Programming in c++Programming in c++
Programming in c++MalarMohana
 
Programming in c++
Programming in c++Programming in c++
Programming in c++sujathavvv
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java Haim Michael
 

Similar to C# programming : Chapter One (20)

Oops ppt
Oops pptOops ppt
Oops ppt
 
1 puc programming using c++
1 puc programming using c++1 puc programming using c++
1 puc programming using c++
 
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptxPROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx
 
Part 1
Part 1Part 1
Part 1
 
c++ referesher 1.pdf
c++ referesher 1.pdfc++ referesher 1.pdf
c++ referesher 1.pdf
 
PRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptxPRINCE PRESENTATION(1).pptx
PRINCE PRESENTATION(1).pptx
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
 
C language
C languageC language
C language
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 
C material
C materialC material
C material
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
Programming in C [Module One]
Programming in C [Module One]Programming in C [Module One]
Programming in C [Module One]
 
PRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdfPRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdf
 
over all view programming to computer
over all view programming to computer over all view programming to computer
over all view programming to computer
 
Introduction to programming using c
Introduction to programming using cIntroduction to programming using c
Introduction to programming using c
 
C tutorials
C tutorialsC tutorials
C tutorials
 
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Functional programming in Java
Functional programming in Java  Functional programming in Java
Functional programming in Java
 

More from Khairi Aiman

Sistem HITeCOB - Suruhanjaya Bangunan COB
Sistem HITeCOB - Suruhanjaya Bangunan COBSistem HITeCOB - Suruhanjaya Bangunan COB
Sistem HITeCOB - Suruhanjaya Bangunan COBKhairi Aiman
 
Overview to Data Transaction Management
Overview to Data Transaction ManagementOverview to Data Transaction Management
Overview to Data Transaction ManagementKhairi Aiman
 
Xamarin.Form : Basic to Mobile Development
Xamarin.Form : Basic to Mobile DevelopmentXamarin.Form : Basic to Mobile Development
Xamarin.Form : Basic to Mobile DevelopmentKhairi Aiman
 
Overview to Xamarin : Understanding Xamarin Architecture
Overview to Xamarin : Understanding Xamarin ArchitectureOverview to Xamarin : Understanding Xamarin Architecture
Overview to Xamarin : Understanding Xamarin ArchitectureKhairi Aiman
 
Xamarin.Forms Application UI XAML Definition
Xamarin.Forms Application UI XAML DefinitionXamarin.Forms Application UI XAML Definition
Xamarin.Forms Application UI XAML DefinitionKhairi Aiman
 
Catalouge 2016 Hery Intelligent Technology
Catalouge 2016 Hery Intelligent TechnologyCatalouge 2016 Hery Intelligent Technology
Catalouge 2016 Hery Intelligent TechnologyKhairi Aiman
 
HIT Catalogue 2016
HIT Catalogue 2016HIT Catalogue 2016
HIT Catalogue 2016Khairi Aiman
 
Prinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & Mukadimah
Prinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & MukadimahPrinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & Mukadimah
Prinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & MukadimahKhairi Aiman
 
Meterpreter in Metasploit User Guide
Meterpreter in Metasploit User GuideMeterpreter in Metasploit User Guide
Meterpreter in Metasploit User GuideKhairi Aiman
 
Hacking SSL When Using RC4
Hacking SSL When Using RC4Hacking SSL When Using RC4
Hacking SSL When Using RC4Khairi Aiman
 
Hery Intelligent Technology - Corporate Profile 2015
Hery Intelligent Technology - Corporate Profile 2015Hery Intelligent Technology - Corporate Profile 2015
Hery Intelligent Technology - Corporate Profile 2015Khairi Aiman
 
CIA Stratergic Communication - September 2004
CIA Stratergic Communication - September 2004CIA Stratergic Communication - September 2004
CIA Stratergic Communication - September 2004Khairi Aiman
 
Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)
Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)
Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)Khairi Aiman
 
Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)
Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)
Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)Khairi Aiman
 
(SOCIAL ENGINEERING - MY) - Psiko rakan kerja
(SOCIAL ENGINEERING - MY) - Psiko rakan kerja(SOCIAL ENGINEERING - MY) - Psiko rakan kerja
(SOCIAL ENGINEERING - MY) - Psiko rakan kerjaKhairi Aiman
 
Burger doll order form
Burger doll order formBurger doll order form
Burger doll order formKhairi Aiman
 
Kiosk teknologi masa kini - Kajian Soalan
Kiosk teknologi masa kini - Kajian SoalanKiosk teknologi masa kini - Kajian Soalan
Kiosk teknologi masa kini - Kajian SoalanKhairi Aiman
 
Hack the book Mini
Hack the book MiniHack the book Mini
Hack the book MiniKhairi Aiman
 

More from Khairi Aiman (20)

Sistem HITeCOB - Suruhanjaya Bangunan COB
Sistem HITeCOB - Suruhanjaya Bangunan COBSistem HITeCOB - Suruhanjaya Bangunan COB
Sistem HITeCOB - Suruhanjaya Bangunan COB
 
Overview to Data Transaction Management
Overview to Data Transaction ManagementOverview to Data Transaction Management
Overview to Data Transaction Management
 
Xamarin.Form : Basic to Mobile Development
Xamarin.Form : Basic to Mobile DevelopmentXamarin.Form : Basic to Mobile Development
Xamarin.Form : Basic to Mobile Development
 
Overview to Xamarin : Understanding Xamarin Architecture
Overview to Xamarin : Understanding Xamarin ArchitectureOverview to Xamarin : Understanding Xamarin Architecture
Overview to Xamarin : Understanding Xamarin Architecture
 
Xamarin.Forms Application UI XAML Definition
Xamarin.Forms Application UI XAML DefinitionXamarin.Forms Application UI XAML Definition
Xamarin.Forms Application UI XAML Definition
 
Catalouge 2016 Hery Intelligent Technology
Catalouge 2016 Hery Intelligent TechnologyCatalouge 2016 Hery Intelligent Technology
Catalouge 2016 Hery Intelligent Technology
 
HIT Catalogue 2016
HIT Catalogue 2016HIT Catalogue 2016
HIT Catalogue 2016
 
Prinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & Mukadimah
Prinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & MukadimahPrinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & Mukadimah
Prinsip perakaunan tinkatan 4 bab 7 Part 1 - Pelarasan & Mukadimah
 
Meterpreter in Metasploit User Guide
Meterpreter in Metasploit User GuideMeterpreter in Metasploit User Guide
Meterpreter in Metasploit User Guide
 
Hacking SSL When Using RC4
Hacking SSL When Using RC4Hacking SSL When Using RC4
Hacking SSL When Using RC4
 
Hery Intelligent Technology - Corporate Profile 2015
Hery Intelligent Technology - Corporate Profile 2015Hery Intelligent Technology - Corporate Profile 2015
Hery Intelligent Technology - Corporate Profile 2015
 
CIA Stratergic Communication - September 2004
CIA Stratergic Communication - September 2004CIA Stratergic Communication - September 2004
CIA Stratergic Communication - September 2004
 
Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)
Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)
Pengaturcaraan C++ - Permarkahan (C++ Programming - Scores)
 
Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)
Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)
Pengaturcaraan C++ - Kalukulator Bulatan (C++ Programming - Circle Calculator)
 
13 May 1969
13 May 196913 May 1969
13 May 1969
 
Bahasa kebangsaan
Bahasa kebangsaanBahasa kebangsaan
Bahasa kebangsaan
 
(SOCIAL ENGINEERING - MY) - Psiko rakan kerja
(SOCIAL ENGINEERING - MY) - Psiko rakan kerja(SOCIAL ENGINEERING - MY) - Psiko rakan kerja
(SOCIAL ENGINEERING - MY) - Psiko rakan kerja
 
Burger doll order form
Burger doll order formBurger doll order form
Burger doll order form
 
Kiosk teknologi masa kini - Kajian Soalan
Kiosk teknologi masa kini - Kajian SoalanKiosk teknologi masa kini - Kajian Soalan
Kiosk teknologi masa kini - Kajian Soalan
 
Hack the book Mini
Hack the book MiniHack the book Mini
Hack the book Mini
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

C# programming : Chapter One

  • 1. XAMARIN MOBILE APPLICATION DEVELOPMENT COURSE Portable Class Library (PCL) using C# Chapter 2 - Basic to C# Programming - Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017)
  • 2. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) What is C# Programming? C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. • Object Oriented • Multi Paradigm Visual Studio 2015. Updated: July 20, 2015. C# (pronounced "C sharp") is a programming language that is designed for building a variety of applications that run on the .NET Framework. C# is simple, powerful, type-safe, and object- oriented.
  • 3. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Program Structure Output : Hello World
  • 4. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Program Structure Terms Explanation + Using + Namespace + Class + Main
  • 5. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Program Structure Terms Explanation + Using This command are use to call (include) another namespace or library. After this call has been made, all variables, classes & methods can be accessed by current program / namespace. This command also use to access property from another namespace or properties. Example are as the above-right. This command has it’s own code block which is every code write are only available or active on it’s own code block. //open of a code block //close current code block
  • 6. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Program Structure Terms Explanation + Namespace Namespace is a collection of classes. In other word, we could say namespace is a name of a program which is contains all functions/methods, variables and classes of a current programs. Namespace has its own code block. The state codes are only active / accessible in its current namespace.
  • 7. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Program Structure Terms Explanation + Class Class is a child code block for a namespace. It contains methods / functions, variables and child classes. For two or more classes in a namespace it called as member class. Classes has its own property called access specifier. For class without access specifier (like the example ‘class HelloWorld’), automatically the class is defined as an Internal Class.
  • 8. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Program Structure Terms Explanation + Main In this example, main is a method / function. Main method is a method where program firstly read and run. Every method has its own type of return value, method type and access specifier. The picture shows that static is a type of method and void is a return value type Void is use to tell the program that the current method has no return value. Static use to define
  • 9. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Access Specifier Access specifier is a definition of class, method and variable. This definition are required by program to define the accessibility to other class and method. Public Can be access publicly to other class even in other namespace Private Only can be access in current method, class or namespace Internal Can be access within the program that contain its declarations and within the same assembly
  • 10. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Data Type Access specifier is a definition of class, method and variable. This definition are required by program to define the accessibility to other class and method. Int Integer, numbers without decimal point String Text Bool Boolean, yes or no OR 1 or 0 long Integer that has long values. Decimal Number with decimal point Float Number with decimal point Double Number with decimal point
  • 11. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Methods A method is a group of statements that together perform tasks. Every C# program has at least one class with a method named Main (the default, first read and run by program). Method code block or Do-Something-Here REMINDER! Access specifier are as mentioned before. Return type are as Data Type mentioned before. “VOID” type are used IF the method has no value to return. Parameter list is where to put the variable from outside of the method to use it inside the method. To write parameter, its required to put Data Type and variable name.
  • 12. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Anonymous Methods Anonymous methods provide a technique to pass a code block as a delegate parameter. Anonymous methods are the methods without a name, just the body. You need not specify the return type in an anonymous method; it is inferred from the return statement inside the method body.
  • 13. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Classes REMINDER! Access specifier are as mentioned before. Class code block contains classes, methods & variables A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. A class is like a blueprint. It defines the data and behaviour of a type.
  • 14. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Conversion • String – ToString, string.Format • Int (16, 32, 64) – ToInt16, ToInt32, ToInt64 • Decimal - ToDecimal
  • 15. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Decision Making If Else Else If Else
  • 16. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Decision Making Switch Case
  • 17. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Loops While Loop
  • 18. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Loops For Loop
  • 19. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Object Oriented Programming Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods. OOP is a solution to state object programmatically. Example: Defining cars programmatically. The code on the left show how to define “Cars” programmatically. It’s a list of car’s properties.
  • 20. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Object Oriented Programming The code on the left show how to create a new car. In programming, its called new instance. Use the dot (.) symbol to access object or class child variables, methods or classes.
  • 21. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Practice Make Perfect Please create a program to collect contacts information. In the contact, must have the name, email and phone number. Please create a program to collect contacts information. In the contact, must have the name, email and phone number. TIPS! • Create a new Contact class with variable name, email and phone number • Create new instance for every new contact.
  • 22. Written by : Mr Hery Copyright® HeryIT® JM0670283-X (2017) Thank You Thank you! You re ready for next course.