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

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
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
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 

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.