SlideShare a Scribd company logo
Introduction to BASIC ProgrammingRepetitionFlowchart
StructureSequenceSelectionRepetition
SEQUENCEIn a computer program or an algorithm,  sequence involves simple steps which are to be executed one after the other.
Make a Flowchart to add two numbers and print the result.STARTS=0: n1=0: n2=0n1, n2S= n1+n2Print SSTOP
DECISION structure
SELECTIONSelection is used in a computer program or algorithm to determine which particular step or set of steps is to be executed
ExampleCompute the sum of x and y if x is greater than y, other wise print d as their difference.Draw a flowchart to find the largest of three numbers A, B, and C.
Repetition
RepetitionRepetition allows for a portion of an algorithm or computer program to be done any number of times dependent on some condition being met. An occurrence of repetition is usually known as a loop.Thebody of the loop is executed repeatedly while the termination condition is true.
Repetition (Pre-Test Structure)A pre-tested loop is so named because the condition has to be met atthe very beginning of the loop. This construct is often called a guarded loop.
Repetition (Post-Test Structure)A post-tested loop executes the body of the loop before testing the termination condition.
This construct is often referred to as an unguarded loop. Variables (in memory):Num    [ 4 ]Result [  ]Count  [  ]Input:Num <- 4Enter a Number => 4Count = 44 > 0 ?  => YESCount = 33 > 0 ?  => YESCount = 22 > 0 ?  => YESCount = 11 > 0 ?  => YESCount = 00 > 0 ?  => NOExample:  What is the output of the following flowchart when the input is  Num= 4Variables (in memory):Num    [ 4 ]Result [ 0 ]Count  [ 4 ]Variables (in memory):Num    [ 4 ]Result [ 7 ] 4 + 3Count  [ 2 ] 3 - 1Variables (in memory):Num    [ 4 ]Result [ 9 ] 7 + 2Count  [ 1 ] 2 - 1Variables (in memory):Num    [   ]Result [  ]Count  [  ]Variables (in memory):Num    [ 4 ]Result [ 10] 9 + 1Count  [ 0 ] 1 - 1Variables (in memory):Num    [ 4 ]Result [ 4 ] 0 + 4Count  [ 3 ] 4 - 1Count: 4Count: 3Count: 2Count: 1Count: 0Result: 10
Assignment
Review for the Long Quiz #3
Selection (Structure)Determine if the input age is qualified to vote or not. If qualified, display “Qualified to vote!” if not, display “Too young!”Given a number, print the message “Positive”, “Negative” or  “Neither”
3. The V. Mapa High School is accepting freshmen who are not more than 15 years old. Given the students’ name and age, print “ACCEPTED” if it meets the ages Requirement otherwise print “Sorry”
4. Due to your poor results in the examination, I decided to increase each one of you by 5 points. Input your grade  and print the new grade. If the original grade exceeds 90, then it remains as is.

More Related Content

PPT
Macros in system programing
PPTX
Computer Register | Computer Science
PDF
loaders and linkers
PPTX
Unit 3 sp assembler
PPT
System software
PPT
Real time-embedded-system-lec-02
PPTX
Cache Coherence.pptx
PPSX
CISC & RISC ARCHITECTURES
Macros in system programing
Computer Register | Computer Science
loaders and linkers
Unit 3 sp assembler
System software
Real time-embedded-system-lec-02
Cache Coherence.pptx
CISC & RISC ARCHITECTURES

What's hot (20)

PPTX
Classification of Programming Languages
PPT
OPERATING SYSTEM
PPT
Operating system services 9
PPT
Fundamental Programming Lect 1
PPTX
Von Neumann vs Harvard Architecture
PPTX
Presentation on Operating System & its Components
PPTX
Assemblers
PPTX
Software engineering quality assurance and testing
PPTX
Programming Languages / Translators
PDF
Code optimization in compiler design
PPT
Pseudocode algorithim flowchart
PPTX
Introduction to Simplified instruction computer or SIC/XE
PPTX
Bootstrap loader
PPTX
Fundamentals of Language Processing
PPT
Software Testing
PPTX
Phases of Compiler
PPTX
C vs JAVA.pptx
PPTX
Rtos concepts
PPTX
Language processor
PPT
Compiler Design Basics
Classification of Programming Languages
OPERATING SYSTEM
Operating system services 9
Fundamental Programming Lect 1
Von Neumann vs Harvard Architecture
Presentation on Operating System & its Components
Assemblers
Software engineering quality assurance and testing
Programming Languages / Translators
Code optimization in compiler design
Pseudocode algorithim flowchart
Introduction to Simplified instruction computer or SIC/XE
Bootstrap loader
Fundamentals of Language Processing
Software Testing
Phases of Compiler
C vs JAVA.pptx
Rtos concepts
Language processor
Compiler Design Basics
Ad

Viewers also liked (20)

PPTX
(Aug.31) introduction to macflash
PPTX
Algorithms and Flowcharts
PPT
Programming loop
PDF
Writing algorithms
PPTX
Algorithm and flowchart
PPT
Bab 1b The Structure Of A Computer Program
PDF
CS4109 Computer System Architecture
PDF
4 introduction to programming structure
PPT
Unit 1 basic structure of computers
PPTX
Flow chart programming
PPT
Computer Structure Slides
PPT
Computer hardware component Created by king parmeshwar pawar
PPTX
Algorithm and flowchart
PPTX
My presentation on 'computer hardware component' {hardware}
PPTX
EASA Part-66 Module 5.6 : Basic Computer Structure
PPTX
ICT, Basic of Computer, Hardware, Various parts of computer hardware, What is...
PPTX
structured programming
PPTX
Introduction to sequence alignment
PPTX
Presentation on computer language
PPT
Generations Of Programming Languages
(Aug.31) introduction to macflash
Algorithms and Flowcharts
Programming loop
Writing algorithms
Algorithm and flowchart
Bab 1b The Structure Of A Computer Program
CS4109 Computer System Architecture
4 introduction to programming structure
Unit 1 basic structure of computers
Flow chart programming
Computer Structure Slides
Computer hardware component Created by king parmeshwar pawar
Algorithm and flowchart
My presentation on 'computer hardware component' {hardware}
EASA Part-66 Module 5.6 : Basic Computer Structure
ICT, Basic of Computer, Hardware, Various parts of computer hardware, What is...
structured programming
Introduction to sequence alignment
Presentation on computer language
Generations Of Programming Languages
Ad

Similar to Introduction to basic programming repetition (20)

PPTX
Introduction to flowchart
PDF
Introductiontoflowchart 110630082600-phpapp01
PPT
Programming algorithms and flowchart.ppt
PPT
Grade 10 flowcharting
PDF
PSP LAB MANUAL.pdf
PPTX
Psuedocode1, algorithm1, Flowchart1.pptx
PDF
Flowcharts. Algorithms and pseudo codepdf
PDF
ALGORITHMS AND FLOWCHARTS
PPTX
ICT_Seminar_flow_charts_for_2013_Nov.pptx
PPT
our c prog work
PPT
Unit 3 Foc
PPTX
Algorithm and flowchart.pptx
PPT
Pengenalan kepada pengaturcaraan berstruktur
PDF
DSA Lesson 2 - Algorithm and Flowcharting.pdf
PPT
Programming.pptVBVBBMCGHFGFDFDHGDFKJKJKKJ;J
PDF
Flowcharting
PPT
Algorithm Designs - Control Structures
PPT
COMPUTER PROGRAMMING UNIT 1 Lecture 4
PPTX
programming part 1 introduction to python.pptx
PDF
Fundamental of Information Technology - UNIT 6
Introduction to flowchart
Introductiontoflowchart 110630082600-phpapp01
Programming algorithms and flowchart.ppt
Grade 10 flowcharting
PSP LAB MANUAL.pdf
Psuedocode1, algorithm1, Flowchart1.pptx
Flowcharts. Algorithms and pseudo codepdf
ALGORITHMS AND FLOWCHARTS
ICT_Seminar_flow_charts_for_2013_Nov.pptx
our c prog work
Unit 3 Foc
Algorithm and flowchart.pptx
Pengenalan kepada pengaturcaraan berstruktur
DSA Lesson 2 - Algorithm and Flowcharting.pdf
Programming.pptVBVBBMCGHFGFDFDHGDFKJKJKKJ;J
Flowcharting
Algorithm Designs - Control Structures
COMPUTER PROGRAMMING UNIT 1 Lecture 4
programming part 1 introduction to python.pptx
Fundamental of Information Technology - UNIT 6

More from Jordan Delacruz (18)

PPTX
Novel analysis
PPTX
Motion tween resize
PPTX
Computer motion tween
PPT
Introduction to layers
PPTX
Graphics
PPTX
(Sept.14)
PPTX
(Sept.7)
PPTX
(Sept.5)
PPTX
(Sept. 8)
PPTX
(Sept6. )
PPTX
(Sept15.)demo
PPTX
(Sept.1) environment
PPTX
Conditional statement ss2
PPTX
Conditional statement ss1
PPTX
Introduction to basic programming
PPTX
Algorithm and flowchart2010
PPT
Arithmetic operator
PPT
Arithmetic operator
Novel analysis
Motion tween resize
Computer motion tween
Introduction to layers
Graphics
(Sept.14)
(Sept.7)
(Sept.5)
(Sept. 8)
(Sept6. )
(Sept15.)demo
(Sept.1) environment
Conditional statement ss2
Conditional statement ss1
Introduction to basic programming
Algorithm and flowchart2010
Arithmetic operator
Arithmetic operator

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Big Data Technologies - Introduction.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Spectral efficient network and resource selection model in 5G networks
MIND Revenue Release Quarter 2 2025 Press Release
Big Data Technologies - Introduction.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Mobile App Security Testing_ A Comprehensive Guide.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf

Introduction to basic programming repetition

  • 1. Introduction to BASIC ProgrammingRepetitionFlowchart
  • 3. SEQUENCEIn a computer program or an algorithm, sequence involves simple steps which are to be executed one after the other.
  • 4. Make a Flowchart to add two numbers and print the result.STARTS=0: n1=0: n2=0n1, n2S= n1+n2Print SSTOP
  • 6. SELECTIONSelection is used in a computer program or algorithm to determine which particular step or set of steps is to be executed
  • 7. ExampleCompute the sum of x and y if x is greater than y, other wise print d as their difference.Draw a flowchart to find the largest of three numbers A, B, and C.
  • 9. RepetitionRepetition allows for a portion of an algorithm or computer program to be done any number of times dependent on some condition being met. An occurrence of repetition is usually known as a loop.Thebody of the loop is executed repeatedly while the termination condition is true.
  • 10. Repetition (Pre-Test Structure)A pre-tested loop is so named because the condition has to be met atthe very beginning of the loop. This construct is often called a guarded loop.
  • 11. Repetition (Post-Test Structure)A post-tested loop executes the body of the loop before testing the termination condition.
  • 12. This construct is often referred to as an unguarded loop. Variables (in memory):Num [ 4 ]Result [ ]Count [ ]Input:Num <- 4Enter a Number => 4Count = 44 > 0 ? => YESCount = 33 > 0 ? => YESCount = 22 > 0 ? => YESCount = 11 > 0 ? => YESCount = 00 > 0 ? => NOExample: What is the output of the following flowchart when the input is Num= 4Variables (in memory):Num [ 4 ]Result [ 0 ]Count [ 4 ]Variables (in memory):Num [ 4 ]Result [ 7 ] 4 + 3Count [ 2 ] 3 - 1Variables (in memory):Num [ 4 ]Result [ 9 ] 7 + 2Count [ 1 ] 2 - 1Variables (in memory):Num [ ]Result [ ]Count [ ]Variables (in memory):Num [ 4 ]Result [ 10] 9 + 1Count [ 0 ] 1 - 1Variables (in memory):Num [ 4 ]Result [ 4 ] 0 + 4Count [ 3 ] 4 - 1Count: 4Count: 3Count: 2Count: 1Count: 0Result: 10
  • 14. Review for the Long Quiz #3
  • 15. Selection (Structure)Determine if the input age is qualified to vote or not. If qualified, display “Qualified to vote!” if not, display “Too young!”Given a number, print the message “Positive”, “Negative” or “Neither”
  • 16. 3. The V. Mapa High School is accepting freshmen who are not more than 15 years old. Given the students’ name and age, print “ACCEPTED” if it meets the ages Requirement otherwise print “Sorry”
  • 17. 4. Due to your poor results in the examination, I decided to increase each one of you by 5 points. Input your grade and print the new grade. If the original grade exceeds 90, then it remains as is.