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

More Related Content

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

Viewers also liked

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
 

Viewers also liked (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 to 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 to 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
 

Recently uploaded

31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 

Recently uploaded (20)

31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 

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.