SlideShare une entreprise Scribd logo
1  sur  23
Getting Dirty – Part 1
Jamshid Hashimi, CodeWeekend
Agenda
• Expressions, Types, and Variables
• Control Statements - Selection
• Control Statements - Loops
• Methods
• Namespaces
• Introduction to Classes
• Class Inheritance
• Polymorphism
Expressions, Types, and Variables
• Variables: storage locations for data
• int num = 428;
• C# is a strongly typed language.
• All operations are based on variable Types
• C# simple types consist of:
• Boolean Type
• 3 numeric type: Integrals, Floating Point, Decimal
• String
Expressions, Types, and Variables
• The Boolean Type
• Declared by keyword: bool
• Has two values: true or false
Expressions, Types, and Variables
• In C++, a value of type bool can be converted to a value of type int; in
other words
• false is equivalent to zero and true is equivalent to nonzero values.
• In C#, there is no conversion between the bool type and other types.
Expressions, Types, and Variables
• Integral Types
• Number, either signed and unsigned and char type
Expressions, Types, and Variables
• Floating Point and Decimal Types
• To represent real numbers
Expressions, Types, and Variables
• The String Type
• A string is a sequence of text characters.
• “This is a string example”
• Some characters are not printable
Expressions, Types, and Variables
• Operands and Operators
• Operand is a piece of information or data
• Operator specifies what action should be done with the operand(s).
• operandOne operator operandTwos
• Expressions
• An expression is simply one or more operands and their associated operator
treated as a single entity.
• answer = operand1 / operand2
Expressions, Types, and Variables
• Statements
• In C#, a program statement is one or more expressions terminated by a
semicolon.
• answer = operand 1 / operand2;
Expressions, Types, and Variables
Expressions, Types, and Variables
• solution = 2 + 3 * 4 + 5;
• Overriding the default Precedence order
• Solution = (2 + 3) * (4 + 5);
Control Statements - Selection
• If statements
• An if statement allows you to take different paths of logic, depending on a
given condition.
• There are two forms of OR:
• Regular OR (|) operator will evaluate both sub-expressions every time.
• Conditional OR (||) will evaluate the second sub-expression only if the first sub-
expression evaluates to false.
• There are two forms of AND:
• Regular AND operator will evaluate both expressions every time.
• Conditional AND operator will evaluate the second sub-expression only when the first
sub-expression evaluates to true.
Control Statements - Selection
• Switch Statements
• A type of selection control mechanism used to allow the value of a variable or
expression to change the control flow of program execution via a multiway
branch.
• Break!
• Go to!
Control Statements - Loops
• Learn the while loop
• A while loop will check a condition and then continues to execute a block of
code as long as the condition evaluates to a boolean value of true.
• Learn the do loop
• A do loop is similar to the while loop, except that it checks its condition at the
end of the loop.
Control Statements - Loops
• Learn the for loop
• By using a for loop, you can run a statement or a block of statements
repeatedly until a specified expression evaluates to false.
• Learn the foreach loop
• The foreach statement repeats a group of embedded statements for each
element in an array or an object collection.
Methods
• Methods are to split our logic into units
• Name should be meaningful
• Should be associated with the task
• Parameters are to transfer information to and from method
attributes modifiers return-type method-name(parameters)
{
statements
}
Methods
• Instance Methods
• Static Methods
• Pass by value
• Pass by reference
• this keyword
Namespaces
• Namespaces are C# program elements designed to help you organize
your programs.
• Also to avoid name conflicts
Introduction to Classes
• Classes are templates to objects
• Constructors
• Instance and Static methods, again!
• Destructors
• To release the allocated resources
Inheritance
• Inheritance is one of the primary concepts of object-oriented
programming. It allows you to reuse existing code.
Polymorphism
• It allows you to invoke derived class methods through a base class
reference during run-time.
• Sending the same message, getting the correct response
Thank You! 

Contenu connexe

Tendances

Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm Madishetty Prathibha
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and InterfaceHaris Bin Zahid
 
Type checking
Type checkingType checking
Type checkingrawan_z
 
Abap Inicio
Abap InicioAbap Inicio
Abap Iniciounifor
 
Ap Power Point Chpt5
Ap Power Point Chpt5Ap Power Point Chpt5
Ap Power Point Chpt5dplunkett
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variablesRavi_Kant_Sahu
 
Abstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and InterfacesAbstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and InterfacesAhmed Nobi
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design GuidelinesMohamed Meligy
 
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Simplilearn
 
Java 8 Functional Programming - I
Java 8 Functional Programming - IJava 8 Functional Programming - I
Java 8 Functional Programming - IUgur Yeter
 
Java essentials for hadoop
Java essentials for hadoopJava essentials for hadoop
Java essentials for hadoopSeo Gyansha
 
SAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH SoftechSAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH SoftechVikram P Madduri
 
Abstract class and interface
Abstract class and interfaceAbstract class and interface
Abstract class and interfaceMazharul Sabbir
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .NetGreg Sohl
 

Tendances (20)

Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Java data types, variables and jvm
Java data types, variables and jvm Java data types, variables and jvm
Java data types, variables and jvm
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
 
Type checking
Type checkingType checking
Type checking
 
Lecture02 java
Lecture02 javaLecture02 java
Lecture02 java
 
Abap Inicio
Abap InicioAbap Inicio
Abap Inicio
 
#_ varible function
#_ varible function #_ varible function
#_ varible function
 
Ap Power Point Chpt5
Ap Power Point Chpt5Ap Power Point Chpt5
Ap Power Point Chpt5
 
Variable
VariableVariable
Variable
 
Basic IO
Basic IOBasic IO
Basic IO
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variables
 
Abstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and InterfacesAbstraction in java [abstract classes and Interfaces
Abstraction in java [abstract classes and Interfaces
 
Framework Design Guidelines
Framework Design GuidelinesFramework Design Guidelines
Framework Design Guidelines
 
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
 
Java 8 Functional Programming - I
Java 8 Functional Programming - IJava 8 Functional Programming - I
Java 8 Functional Programming - I
 
Datatype
DatatypeDatatype
Datatype
 
Java essentials for hadoop
Java essentials for hadoopJava essentials for hadoop
Java essentials for hadoop
 
SAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH SoftechSAP ABAP using OOPS - JH Softech
SAP ABAP using OOPS - JH Softech
 
Abstract class and interface
Abstract class and interfaceAbstract class and interface
Abstract class and interface
 
Object Oriented Programming In .Net
Object Oriented Programming In .NetObject Oriented Programming In .Net
Object Oriented Programming In .Net
 

Similaire à Week 1: Getting Your Hands Dirty - Part 1

L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variablesteach4uin
 
OOP - Lecture04 - Variables, DataTypes and TypeConversion.pptx
OOP - Lecture04 - Variables, DataTypes and TypeConversion.pptxOOP - Lecture04 - Variables, DataTypes and TypeConversion.pptx
OOP - Lecture04 - Variables, DataTypes and TypeConversion.pptxAhmedMehmood35
 
Android webinar class_java_review
Android webinar class_java_reviewAndroid webinar class_java_review
Android webinar class_java_reviewEdureka!
 
Introduction to c
Introduction to cIntroduction to c
Introduction to cAjeet Kumar
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)Dilawar Khan
 
Learning core java
Learning core javaLearning core java
Learning core javaAbhay Bharti
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Rasan Samarasinghe
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingEric Chou
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteTushar B Kute
 

Similaire à Week 1: Getting Your Hands Dirty - Part 1 (20)

data types.pdf
data types.pdfdata types.pdf
data types.pdf
 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variables
 
8 statement level
8 statement level8 statement level
8 statement level
 
OOP - Lecture04 - Variables, DataTypes and TypeConversion.pptx
OOP - Lecture04 - Variables, DataTypes and TypeConversion.pptxOOP - Lecture04 - Variables, DataTypes and TypeConversion.pptx
OOP - Lecture04 - Variables, DataTypes and TypeConversion.pptx
 
Csc240 -lecture_4
Csc240  -lecture_4Csc240  -lecture_4
Csc240 -lecture_4
 
Android webinar class_java_review
Android webinar class_java_reviewAndroid webinar class_java_review
Android webinar class_java_review
 
basics dart.pdf
basics dart.pdfbasics dart.pdf
basics dart.pdf
 
Lecture-13.ppt
Lecture-13.pptLecture-13.ppt
Lecture-13.ppt
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
chapter 5.ppt
chapter 5.pptchapter 5.ppt
chapter 5.ppt
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)
 
Learning core java
Learning core javaLearning core java
Learning core java
 
Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++Esoft Metro Campus - Programming with C++
Esoft Metro Campus - Programming with C++
 
Python Basics.pptx
Python Basics.pptxPython Basics.pptx
Python Basics.pptx
 
Chapter 2: Elementary Programming
Chapter 2: Elementary ProgrammingChapter 2: Elementary Programming
Chapter 2: Elementary Programming
 
Java Basics
Java BasicsJava Basics
Java Basics
 
unit1 python.pptx
unit1 python.pptxunit1 python.pptx
unit1 python.pptx
 
Introduction to c
Introduction to cIntroduction to c
Introduction to c
 
Subprogram
SubprogramSubprogram
Subprogram
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 

Plus de Jamshid Hashimi

Introduction to C# - Week 0
Introduction to C# - Week 0Introduction to C# - Week 0
Introduction to C# - Week 0Jamshid Hashimi
 
RIST - Research Institute for Science and Technology
RIST - Research Institute for Science and TechnologyRIST - Research Institute for Science and Technology
RIST - Research Institute for Science and TechnologyJamshid Hashimi
 
How Coding Can Make Your Life Better
How Coding Can Make Your Life BetterHow Coding Can Make Your Life Better
How Coding Can Make Your Life BetterJamshid Hashimi
 
Tips for Writing Better Code
Tips for Writing Better CodeTips for Writing Better Code
Tips for Writing Better CodeJamshid Hashimi
 
Launch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media IntegrationLaunch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media IntegrationJamshid Hashimi
 
Introduction to Blogging
Introduction to BloggingIntroduction to Blogging
Introduction to BloggingJamshid Hashimi
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to WordpressJamshid Hashimi
 
CodeIgniter Helper Functions
CodeIgniter Helper FunctionsCodeIgniter Helper Functions
CodeIgniter Helper FunctionsJamshid Hashimi
 
CodeIgniter Class Reference
CodeIgniter Class ReferenceCodeIgniter Class Reference
CodeIgniter Class ReferenceJamshid Hashimi
 
Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniterJamshid Hashimi
 
PHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterPHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterJamshid Hashimi
 

Plus de Jamshid Hashimi (20)

Introduction to C# - Week 0
Introduction to C# - Week 0Introduction to C# - Week 0
Introduction to C# - Week 0
 
RIST - Research Institute for Science and Technology
RIST - Research Institute for Science and TechnologyRIST - Research Institute for Science and Technology
RIST - Research Institute for Science and Technology
 
How Coding Can Make Your Life Better
How Coding Can Make Your Life BetterHow Coding Can Make Your Life Better
How Coding Can Make Your Life Better
 
Mobile Vision
Mobile VisionMobile Vision
Mobile Vision
 
Tips for Writing Better Code
Tips for Writing Better CodeTips for Writing Better Code
Tips for Writing Better Code
 
Launch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media IntegrationLaunch Your Local Blog & Social Media Integration
Launch Your Local Blog & Social Media Integration
 
Customizing Your Blog 2
Customizing Your Blog 2Customizing Your Blog 2
Customizing Your Blog 2
 
Customizing Your Blog 1
Customizing Your Blog 1Customizing Your Blog 1
Customizing Your Blog 1
 
Introduction to Blogging
Introduction to BloggingIntroduction to Blogging
Introduction to Blogging
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to Wordpress
 
CodeIgniter Helper Functions
CodeIgniter Helper FunctionsCodeIgniter Helper Functions
CodeIgniter Helper Functions
 
CodeIgniter Class Reference
CodeIgniter Class ReferenceCodeIgniter Class Reference
CodeIgniter Class Reference
 
Managing Applications in CodeIgniter
Managing Applications in CodeIgniterManaging Applications in CodeIgniter
Managing Applications in CodeIgniter
 
CodeIgniter Practice
CodeIgniter PracticeCodeIgniter Practice
CodeIgniter Practice
 
CodeIgniter & MVC
CodeIgniter & MVCCodeIgniter & MVC
CodeIgniter & MVC
 
PHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniterPHP Frameworks & Introduction to CodeIgniter
PHP Frameworks & Introduction to CodeIgniter
 
Exception & Database
Exception & DatabaseException & Database
Exception & Database
 
MySQL Record Operations
MySQL Record OperationsMySQL Record Operations
MySQL Record Operations
 
MySQL JOIN & UNION
MySQL JOIN & UNIONMySQL JOIN & UNION
MySQL JOIN & UNION
 
MySQL basics
MySQL basicsMySQL basics
MySQL basics
 

Dernier

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Dernier (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Week 1: Getting Your Hands Dirty - Part 1

  • 1. Getting Dirty – Part 1 Jamshid Hashimi, CodeWeekend
  • 2. Agenda • Expressions, Types, and Variables • Control Statements - Selection • Control Statements - Loops • Methods • Namespaces • Introduction to Classes • Class Inheritance • Polymorphism
  • 3. Expressions, Types, and Variables • Variables: storage locations for data • int num = 428; • C# is a strongly typed language. • All operations are based on variable Types • C# simple types consist of: • Boolean Type • 3 numeric type: Integrals, Floating Point, Decimal • String
  • 4. Expressions, Types, and Variables • The Boolean Type • Declared by keyword: bool • Has two values: true or false
  • 5. Expressions, Types, and Variables • In C++, a value of type bool can be converted to a value of type int; in other words • false is equivalent to zero and true is equivalent to nonzero values. • In C#, there is no conversion between the bool type and other types.
  • 6. Expressions, Types, and Variables • Integral Types • Number, either signed and unsigned and char type
  • 7. Expressions, Types, and Variables • Floating Point and Decimal Types • To represent real numbers
  • 8. Expressions, Types, and Variables • The String Type • A string is a sequence of text characters. • “This is a string example” • Some characters are not printable
  • 9. Expressions, Types, and Variables • Operands and Operators • Operand is a piece of information or data • Operator specifies what action should be done with the operand(s). • operandOne operator operandTwos • Expressions • An expression is simply one or more operands and their associated operator treated as a single entity. • answer = operand1 / operand2
  • 10. Expressions, Types, and Variables • Statements • In C#, a program statement is one or more expressions terminated by a semicolon. • answer = operand 1 / operand2;
  • 12. Expressions, Types, and Variables • solution = 2 + 3 * 4 + 5; • Overriding the default Precedence order • Solution = (2 + 3) * (4 + 5);
  • 13. Control Statements - Selection • If statements • An if statement allows you to take different paths of logic, depending on a given condition. • There are two forms of OR: • Regular OR (|) operator will evaluate both sub-expressions every time. • Conditional OR (||) will evaluate the second sub-expression only if the first sub- expression evaluates to false. • There are two forms of AND: • Regular AND operator will evaluate both expressions every time. • Conditional AND operator will evaluate the second sub-expression only when the first sub-expression evaluates to true.
  • 14. Control Statements - Selection • Switch Statements • A type of selection control mechanism used to allow the value of a variable or expression to change the control flow of program execution via a multiway branch. • Break! • Go to!
  • 15. Control Statements - Loops • Learn the while loop • A while loop will check a condition and then continues to execute a block of code as long as the condition evaluates to a boolean value of true. • Learn the do loop • A do loop is similar to the while loop, except that it checks its condition at the end of the loop.
  • 16. Control Statements - Loops • Learn the for loop • By using a for loop, you can run a statement or a block of statements repeatedly until a specified expression evaluates to false. • Learn the foreach loop • The foreach statement repeats a group of embedded statements for each element in an array or an object collection.
  • 17. Methods • Methods are to split our logic into units • Name should be meaningful • Should be associated with the task • Parameters are to transfer information to and from method attributes modifiers return-type method-name(parameters) { statements }
  • 18. Methods • Instance Methods • Static Methods • Pass by value • Pass by reference • this keyword
  • 19. Namespaces • Namespaces are C# program elements designed to help you organize your programs. • Also to avoid name conflicts
  • 20. Introduction to Classes • Classes are templates to objects • Constructors • Instance and Static methods, again! • Destructors • To release the allocated resources
  • 21. Inheritance • Inheritance is one of the primary concepts of object-oriented programming. It allows you to reuse existing code.
  • 22. Polymorphism • It allows you to invoke derived class methods through a base class reference during run-time. • Sending the same message, getting the correct response