SlideShare a Scribd company logo
4
Most read
5
Most read
15
Most read
Logical Structures
Lecture 02
LOGICAL STRUCTURES
• There is a code running behind every software contain all sort of
terms and symbols. It can be break down into three simple
programming structures, which is called logical structures.
• Logical structures determine how your program will execute the
step by step process you have defined.
LOGICAL STRUCTURES
• One of the most important concepts of programming is the ability
to control a program so that different lines of code are executed
in proper way or that some lines of code are executed many times
for this Logical Structures are used.
• It basically analyzes and chooses in which direction a program
flows based on certain parameters or conditions.
LOGICAL STRUCTURES
• In computer programming there are three basic logical structures
that are widely used.
• Sequence
• Selection
• Loop
Sequence
• A sequence refers to a series of actions or steps that should be
followed one after another to complete a certain task to achieve a
goal.
• If we don’t put every step in the right sequence, the end result
isn’t what we wanted.
Sequence in Daily life
• Sequence applies in many aspects of our daily life. From simple
house chores to mathematic, if you want to solve a problem you
need to follow a certain set of actions in sequence.
• If you miss any of the steps of change the sequence the end result
can be different that what’s expected!
• Example:
• Have you ever planned a trip with your family or friends?
Sequence in Computer Science
• Sequence, the order that commands are executed by a computer,
allows us to carry out tasks that have multiple steps.
• A computer can only do what it is programmed to do. If the steps
are programmed in the wrong sequence, the computer will
perform the tasks in this sequence – even if this is incorrect.
Why Sequence?
• Proper sequence of coding gives proper working program.
• Machine understands proper sequence coding.
• It is important to follow sequencing to get desired
outcomes(softwares).
• In programming, computer can only carry out tasks that are in the
correct sequence. Computers are machines and they have to do
things the way they were built to do.
Example
• Do you know how to change a computer desktop background
image?
• Right click on your desktop and choose personalize.
• Select picture from the background list.
• Click a new picture for the background.
Example
Selection
• Selection are also known as conditions.
• Selections are a bit different and helps in
making decisions.
• Selection also called Conditionals are
expressions that evaluate to either true or
false. They are mostly used to determine
Program Flow through if statements.
Why Conditions?
• Conditions allow us to control what the program does and perform
different actions based on these "if, then" logic statements.
• What makes computer programs great is the ability to interact
with a user- this is only possible with conditions that direct this
type of interaction.
• Selection or condition help you in making decisions.
• Instead of following a specific order of events, they ask a question
in order to figure out which path to take next.
Conditions in Daily Life
• Conditions are part of our daily life.
• We question our self andmake decisions.
• If you are hungry -> you will eat food.
• If you are Thirsty -> You will drink water.
• If tomorrow is your exam -> you will study.
Conditions
LOOPS
• Loop means to repeat a same step for multiple
number of times to complete a tasks.
• It is also termed as Repetition or iteration.
• e.g:
• You can notice loops in nature. 4 seasons change and
repeat each year.
• walking, breathe, sleep
LOOP
LOOP
When programmers write code, This allows
them to write the code once and repeat it as
many times as needed, making it more likely for
the program to run as expected
Loops can be very useful and can save a lot of
time.
LOOP

More Related Content

PPTX
Categories of computers and computer languages ppt
PPT
Basic Economics for Elementary
PPTX
Managing files and folder in windows 10
PPTX
Computer
PPTX
SCIENCE GRADE 5 - SEED.pptx
PPS
Shapes of computers
PDF
Geography of islamic world
PPTX
E content internet ii
Categories of computers and computer languages ppt
Basic Economics for Elementary
Managing files and folder in windows 10
Computer
SCIENCE GRADE 5 - SEED.pptx
Shapes of computers
Geography of islamic world
E content internet ii

Similar to Logical Structures (20)

PPT
Lect 3-4 Zaheer Abbas
PDF
0-Slot05-06-07-Basic-Logics.pdf
PPTX
Unit-5 Principles of Programming .pptx
PDF
PPTX
APP_Unit 1_updated.pptx
PPTX
1.4 conditions and loops
PPTX
Basics of Programming.pptx
PPTX
programming part 1 introduction to python.pptx
PDF
Introduction to computer science ch3 programming
PDF
Python Programming - III. Controlling the Flow
PPT
Programming
PPT
3. control statements
PPTX
Control Structures of Programming (Introduction to Programming Concepts)
PPTX
Looping and switch cases
PPT
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
PPTX
LESSON 6-Computer programming control structure 1
PPTX
programming and languages (chapter 14)
PPT
Control structure C++
PDF
Fundamentals of Computer Programming Summary of Flow Controls
PDF
65_96195_CC112_2014_1__1_1_week1.pdf
Lect 3-4 Zaheer Abbas
0-Slot05-06-07-Basic-Logics.pdf
Unit-5 Principles of Programming .pptx
APP_Unit 1_updated.pptx
1.4 conditions and loops
Basics of Programming.pptx
programming part 1 introduction to python.pptx
Introduction to computer science ch3 programming
Python Programming - III. Controlling the Flow
Programming
3. control statements
Control Structures of Programming (Introduction to Programming Concepts)
Looping and switch cases
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
LESSON 6-Computer programming control structure 1
programming and languages (chapter 14)
Control structure C++
Fundamentals of Computer Programming Summary of Flow Controls
65_96195_CC112_2014_1__1_1_week1.pdf
Ad

More from Ismail Hussain (10)

PPTX
Exploring Forms of Business Organization: A Complete Guide
PPTX
Understanding the Basics of Entrepreneurship
PPTX
Understanding Logical Structures: Sequence, Selection, and Repetition
PPTX
Algorithm (Basic Algorithm Presentation).pptx
PPTX
Computer Vision Presentation
PPTX
Understanding Artificial Intelligence: Concepts, Applications, and Future Trends
PPTX
Branding Strategy in Marketing
PPTX
Software Testing Technique in Software Engineering
PPTX
Understanding Real GDP: Measurement, Importance, and Economic Impacts
PPTX
Generation of computer
Exploring Forms of Business Organization: A Complete Guide
Understanding the Basics of Entrepreneurship
Understanding Logical Structures: Sequence, Selection, and Repetition
Algorithm (Basic Algorithm Presentation).pptx
Computer Vision Presentation
Understanding Artificial Intelligence: Concepts, Applications, and Future Trends
Branding Strategy in Marketing
Software Testing Technique in Software Engineering
Understanding Real GDP: Measurement, Importance, and Economic Impacts
Generation of computer
Ad

Recently uploaded (20)

PDF
Pre independence Education in Inndia.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
master seminar digital applications in india
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
Classroom Observation Tools for Teachers
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Lesson notes of climatology university.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
01-Introduction-to-Information-Management.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Cell Structure & Organelles in detailed.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Pre independence Education in Inndia.pdf
Complications of Minimal Access Surgery at WLH
Anesthesia in Laparoscopic Surgery in India
master seminar digital applications in india
STATICS OF THE RIGID BODIES Hibbelers.pdf
RMMM.pdf make it easy to upload and study
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
VCE English Exam - Section C Student Revision Booklet
Lesson notes of climatology university.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
01-Introduction-to-Information-Management.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Cell Structure & Organelles in detailed.
Final Presentation General Medicine 03-08-2024.pptx

Logical Structures

  • 2. LOGICAL STRUCTURES • There is a code running behind every software contain all sort of terms and symbols. It can be break down into three simple programming structures, which is called logical structures. • Logical structures determine how your program will execute the step by step process you have defined.
  • 3. LOGICAL STRUCTURES • One of the most important concepts of programming is the ability to control a program so that different lines of code are executed in proper way or that some lines of code are executed many times for this Logical Structures are used. • It basically analyzes and chooses in which direction a program flows based on certain parameters or conditions.
  • 4. LOGICAL STRUCTURES • In computer programming there are three basic logical structures that are widely used. • Sequence • Selection • Loop
  • 5. Sequence • A sequence refers to a series of actions or steps that should be followed one after another to complete a certain task to achieve a goal. • If we don’t put every step in the right sequence, the end result isn’t what we wanted.
  • 6. Sequence in Daily life • Sequence applies in many aspects of our daily life. From simple house chores to mathematic, if you want to solve a problem you need to follow a certain set of actions in sequence. • If you miss any of the steps of change the sequence the end result can be different that what’s expected! • Example: • Have you ever planned a trip with your family or friends?
  • 7. Sequence in Computer Science • Sequence, the order that commands are executed by a computer, allows us to carry out tasks that have multiple steps. • A computer can only do what it is programmed to do. If the steps are programmed in the wrong sequence, the computer will perform the tasks in this sequence – even if this is incorrect.
  • 8. Why Sequence? • Proper sequence of coding gives proper working program. • Machine understands proper sequence coding. • It is important to follow sequencing to get desired outcomes(softwares). • In programming, computer can only carry out tasks that are in the correct sequence. Computers are machines and they have to do things the way they were built to do.
  • 9. Example • Do you know how to change a computer desktop background image? • Right click on your desktop and choose personalize. • Select picture from the background list. • Click a new picture for the background.
  • 11. Selection • Selection are also known as conditions. • Selections are a bit different and helps in making decisions. • Selection also called Conditionals are expressions that evaluate to either true or false. They are mostly used to determine Program Flow through if statements.
  • 12. Why Conditions? • Conditions allow us to control what the program does and perform different actions based on these "if, then" logic statements. • What makes computer programs great is the ability to interact with a user- this is only possible with conditions that direct this type of interaction. • Selection or condition help you in making decisions. • Instead of following a specific order of events, they ask a question in order to figure out which path to take next.
  • 13. Conditions in Daily Life • Conditions are part of our daily life. • We question our self andmake decisions. • If you are hungry -> you will eat food. • If you are Thirsty -> You will drink water. • If tomorrow is your exam -> you will study.
  • 15. LOOPS • Loop means to repeat a same step for multiple number of times to complete a tasks. • It is also termed as Repetition or iteration. • e.g: • You can notice loops in nature. 4 seasons change and repeat each year. • walking, breathe, sleep
  • 16. LOOP
  • 17. LOOP When programmers write code, This allows them to write the code once and repeat it as many times as needed, making it more likely for the program to run as expected Loops can be very useful and can save a lot of time.
  • 18. LOOP