SlideShare a Scribd company logo
1 of 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! 

More Related Content

What's hot

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
 

What's hot (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
 

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 

Recently uploaded (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 

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