SlideShare una empresa de Scribd logo
1 de 11
PROGRAMMING
CONCEPTS
By Joshpal Sahota
INTRODUCTION
• In this presentation I will be explaining the very basics of programming and
will include the following programming concepts in my presentation:





SELECTION
ITERATION
DATA STRUCTURE
FUNCTIONS, PARAMETERS AND/OR RETURN VALUES
TUTORIAL LESSON – PART 1
(SELECTION)
IF ELSE STATEMENTS
• An if statements can be used conjunctively with if else statements.
• When the Boolean expression of an if statement is false, the if else statement
will be executed.

• Else if statements are incredibly useful when testing a number of conditions.
• Else statements are use when none of the other conditions are true.
TUTORIAL LESSON – PART 1
(SELECTION)
TUTORIAL LESSON – PART 1
(SELECTION CONTINUED)
SWITCH STATEMENTS
• These are very similar to if statements, only it has many more conditions.
• Switch statements tend to run faster than if statements.
• They can be used with any numerical data type for example, char and int
but not with text data types such as string.
TUTORIAL LESSON – PART 1
(SELECTION CONTINUED)
TUTORIAL LESSON – PART 2
(ITERATION)
• The ultimate use of a loop is to repeat a block of code and is one of the
most useful tasks in programming.
• There are different types of loops, FOR loops are the most useful as they are
an easy way of creating loops when the number of iterations are known.
TUTORIAL LESSON – PART 3
(DATA STRUCTURE)
• When including structures we must use the struct keyword followed by the
structure name.
• The curly brackets after struct will declare the things that are contained
within the structure.
• Struct is only a definition for what the structure will look like and so you have
to declare a structure in memory of the student type. We will call it stud.
• In order to access the structure name and the sub item a „.‟ must be used
between the two.
TUTORIAL LESSON – PART 3
(DATA STRUCTURE CONTINUED)
• Arrays are a group of variables that uses one name instead of many.
Individual variables are accessible by using a number.
• To declare an array you must include square brackets after the name of the
array.
• The square brackets must include a number of variables/elements which are
included within the array.
• The number of arrays start from 0 (not 1) and can be displayed below the
declaration of the array.
TUTORIAL LESSON – PART 4
• We use the code “#include <iostream>” which will allow us to print words on
the screen.
• The code “using namespace std;” will allow you to enter lines of code
without having to write out the full code.
• “int main()
{
}”
The curly brackets show where the main function starts and ends. Every
program must include a main function and the word „int‟ is to give an
indication as to what the return value will be.
TUTORIAL LESSON – PART 4

Más contenido relacionado

La actualidad más candente (16)

CubeIT Tech - Algorithms
CubeIT Tech - AlgorithmsCubeIT Tech - Algorithms
CubeIT Tech - Algorithms
 
Some tips for taking the High School AP Java college board exam
Some tips for taking the High School  AP Java college board examSome tips for taking the High School  AP Java college board exam
Some tips for taking the High School AP Java college board exam
 
Accessing non static members from the main
Accessing non static members from the mainAccessing non static members from the main
Accessing non static members from the main
 
Structure in c
Structure in cStructure in c
Structure in c
 
3rd june
3rd june3rd june
3rd june
 
OOP in C#
OOP in C#OOP in C#
OOP in C#
 
Oop interfaces
Oop interfacesOop interfaces
Oop interfaces
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
Abstract class in java
Abstract class in javaAbstract class in java
Abstract class in java
 
Chapter 3.1
Chapter 3.1Chapter 3.1
Chapter 3.1
 
Algo>Abstract data type
Algo>Abstract data typeAlgo>Abstract data type
Algo>Abstract data type
 
Elixir
ElixirElixir
Elixir
 
Python functions
Python   functionsPython   functions
Python functions
 
Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1
 
Lect10
Lect10Lect10
Lect10
 
Ppt lesson 07
Ppt lesson 07Ppt lesson 07
Ppt lesson 07
 

Destacado

Jai maa-polymers
Jai maa-polymersJai maa-polymers
Jai maa-polymersjaimaas
 
Yaumul hisab dirasah islamiah
Yaumul hisab dirasah islamiahYaumul hisab dirasah islamiah
Yaumul hisab dirasah islamiahSulthan Al-Fatih
 
Cara kerja internet
Cara kerja internetCara kerja internet
Cara kerja internetaldisofyan
 
Reach Out Academy Annual Report 2015
Reach Out Academy  Annual Report 2015Reach Out Academy  Annual Report 2015
Reach Out Academy Annual Report 2015Karim Soliman
 
Social media strategy for ieee cusb
Social media strategy for ieee cusbSocial media strategy for ieee cusb
Social media strategy for ieee cusbKarim Soliman
 
Презентация Гусевского хрустального завода
Презентация Гусевского хрустального заводаПрезентация Гусевского хрустального завода
Презентация Гусевского хрустального заводаАлексей Федотов
 
Blackboard assessments
Blackboard assessmentsBlackboard assessments
Blackboard assessmentsdattolia
 
Towergroup mobile photo_bill_pay_wp
Towergroup mobile photo_bill_pay_wpTowergroup mobile photo_bill_pay_wp
Towergroup mobile photo_bill_pay_wpRaja Raja
 
The art in social media
The art in social media The art in social media
The art in social media Karim Soliman
 
Unlocking Resilience through Culture
Unlocking Resilience through CultureUnlocking Resilience through Culture
Unlocking Resilience through CultureFuture Catalyst
 
OKRs for social media specialist
OKRs for social media specialistOKRs for social media specialist
OKRs for social media specialistKarim Soliman
 
Guide me to the Market - دٌلنى على السوق
Guide me to the Market - دٌلنى على السوقGuide me to the Market - دٌلنى على السوق
Guide me to the Market - دٌلنى على السوقKarim Soliman
 
האמנה החדשה של עיריית בני ברק
האמנה החדשה של עיריית בני ברקהאמנה החדשה של עיריית בני ברק
האמנה החדשה של עיריית בני ברקRoy Eyal
 
Marketing Management
Marketing Management Marketing Management
Marketing Management Karim Soliman
 

Destacado (20)

Ims brochure 2015
Ims brochure 2015Ims brochure 2015
Ims brochure 2015
 
sgd 6
sgd 6sgd 6
sgd 6
 
Jai maa-polymers
Jai maa-polymersJai maa-polymers
Jai maa-polymers
 
Yaumul hisab dirasah islamiah
Yaumul hisab dirasah islamiahYaumul hisab dirasah islamiah
Yaumul hisab dirasah islamiah
 
Cara kerja internet
Cara kerja internetCara kerja internet
Cara kerja internet
 
Biologia
BiologiaBiologia
Biologia
 
Reach Out Academy Annual Report 2015
Reach Out Academy  Annual Report 2015Reach Out Academy  Annual Report 2015
Reach Out Academy Annual Report 2015
 
Social media strategy for ieee cusb
Social media strategy for ieee cusbSocial media strategy for ieee cusb
Social media strategy for ieee cusb
 
Dirasah islamiyah tauhid
Dirasah islamiyah tauhidDirasah islamiyah tauhid
Dirasah islamiyah tauhid
 
อาเซ ยน
อาเซ ยนอาเซ ยน
อาเซ ยน
 
Презентация Гусевского хрустального завода
Презентация Гусевского хрустального заводаПрезентация Гусевского хрустального завода
Презентация Гусевского хрустального завода
 
Blackboard assessments
Blackboard assessmentsBlackboard assessments
Blackboard assessments
 
Towergroup mobile photo_bill_pay_wp
Towergroup mobile photo_bill_pay_wpTowergroup mobile photo_bill_pay_wp
Towergroup mobile photo_bill_pay_wp
 
The art in social media
The art in social media The art in social media
The art in social media
 
Unlocking Resilience through Culture
Unlocking Resilience through CultureUnlocking Resilience through Culture
Unlocking Resilience through Culture
 
Slide TF
Slide TFSlide TF
Slide TF
 
OKRs for social media specialist
OKRs for social media specialistOKRs for social media specialist
OKRs for social media specialist
 
Guide me to the Market - دٌلنى على السوق
Guide me to the Market - دٌلنى على السوقGuide me to the Market - دٌلنى على السوق
Guide me to the Market - دٌلنى على السوق
 
האמנה החדשה של עיריית בני ברק
האמנה החדשה של עיריית בני ברקהאמנה החדשה של עיריית בני ברק
האמנה החדשה של עיריית בני ברק
 
Marketing Management
Marketing Management Marketing Management
Marketing Management
 

Similar a Programming Concepts

Computer Sience, This is my presentation for beginners coding in python
Computer Sience, This is my presentation for beginners coding in pythonComputer Sience, This is my presentation for beginners coding in python
Computer Sience, This is my presentation for beginners coding in pythonalin173596
 
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical ExpressionsUnit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressionsdubon07
 
python presentation.pptx
python presentation.pptxpython presentation.pptx
python presentation.pptxNightTune44
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2ndConnex
 
Java platform
Java platformJava platform
Java platformVisithan
 
Enumerations in java.pptx
Enumerations in java.pptxEnumerations in java.pptx
Enumerations in java.pptxSrizan Pokrel
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3Vijay Perepa
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxR S Anu Prabha
 
Md06 advance class features
Md06 advance class featuresMd06 advance class features
Md06 advance class featuresRakesh Madugula
 
c-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.pptc-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.pptVinayakHospet1
 
Should begin with a letter and may contain additional letters and di.pdf
Should begin with a letter and may contain additional letters and di.pdfShould begin with a letter and may contain additional letters and di.pdf
Should begin with a letter and may contain additional letters and di.pdfsudhinjv
 
CSharp for Unity Day 3
CSharp for Unity Day 3CSharp for Unity Day 3
CSharp for Unity Day 3Duong Thanh
 

Similar a Programming Concepts (20)

Computer Sience, This is my presentation for beginners coding in python
Computer Sience, This is my presentation for beginners coding in pythonComputer Sience, This is my presentation for beginners coding in python
Computer Sience, This is my presentation for beginners coding in python
 
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical ExpressionsUnit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
 
python presentation.pptx
python presentation.pptxpython presentation.pptx
python presentation.pptx
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2nd
 
Java platform
Java platformJava platform
Java platform
 
Enumerations in java.pptx
Enumerations in java.pptxEnumerations in java.pptx
Enumerations in java.pptx
 
12.6-12.9.pptx
12.6-12.9.pptx12.6-12.9.pptx
12.6-12.9.pptx
 
Java best practices
Java best practicesJava best practices
Java best practices
 
E learning excel vba programming lesson 3
E learning excel vba programming  lesson 3E learning excel vba programming  lesson 3
E learning excel vba programming lesson 3
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptx
 
Md06 advance class features
Md06 advance class featuresMd06 advance class features
Md06 advance class features
 
ITFT - Java
ITFT - JavaITFT - Java
ITFT - Java
 
c-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.pptc-coding-standards-and-best-programming-practices.ppt
c-coding-standards-and-best-programming-practices.ppt
 
Data structure
Data structureData structure
Data structure
 
Should begin with a letter and may contain additional letters and di.pdf
Should begin with a letter and may contain additional letters and di.pdfShould begin with a letter and may contain additional letters and di.pdf
Should begin with a letter and may contain additional letters and di.pdf
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
 
CSharp for Unity Day 3
CSharp for Unity Day 3CSharp for Unity Day 3
CSharp for Unity Day 3
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
JAVA.pptx
JAVA.pptxJAVA.pptx
JAVA.pptx
 

Último

Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
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
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
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
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
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
 
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
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in 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
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 

Último (20)

Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
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
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
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
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
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...
 
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
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
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
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 

Programming Concepts

  • 2. INTRODUCTION • In this presentation I will be explaining the very basics of programming and will include the following programming concepts in my presentation:     SELECTION ITERATION DATA STRUCTURE FUNCTIONS, PARAMETERS AND/OR RETURN VALUES
  • 3. TUTORIAL LESSON – PART 1 (SELECTION) IF ELSE STATEMENTS • An if statements can be used conjunctively with if else statements. • When the Boolean expression of an if statement is false, the if else statement will be executed. • Else if statements are incredibly useful when testing a number of conditions. • Else statements are use when none of the other conditions are true.
  • 4. TUTORIAL LESSON – PART 1 (SELECTION)
  • 5. TUTORIAL LESSON – PART 1 (SELECTION CONTINUED) SWITCH STATEMENTS • These are very similar to if statements, only it has many more conditions. • Switch statements tend to run faster than if statements. • They can be used with any numerical data type for example, char and int but not with text data types such as string.
  • 6. TUTORIAL LESSON – PART 1 (SELECTION CONTINUED)
  • 7. TUTORIAL LESSON – PART 2 (ITERATION) • The ultimate use of a loop is to repeat a block of code and is one of the most useful tasks in programming. • There are different types of loops, FOR loops are the most useful as they are an easy way of creating loops when the number of iterations are known.
  • 8. TUTORIAL LESSON – PART 3 (DATA STRUCTURE) • When including structures we must use the struct keyword followed by the structure name. • The curly brackets after struct will declare the things that are contained within the structure. • Struct is only a definition for what the structure will look like and so you have to declare a structure in memory of the student type. We will call it stud. • In order to access the structure name and the sub item a „.‟ must be used between the two.
  • 9. TUTORIAL LESSON – PART 3 (DATA STRUCTURE CONTINUED) • Arrays are a group of variables that uses one name instead of many. Individual variables are accessible by using a number. • To declare an array you must include square brackets after the name of the array. • The square brackets must include a number of variables/elements which are included within the array. • The number of arrays start from 0 (not 1) and can be displayed below the declaration of the array.
  • 10. TUTORIAL LESSON – PART 4 • We use the code “#include <iostream>” which will allow us to print words on the screen. • The code “using namespace std;” will allow you to enter lines of code without having to write out the full code. • “int main() { }” The curly brackets show where the main function starts and ends. Every program must include a main function and the word „int‟ is to give an indication as to what the return value will be.