SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
Flowcharts and Algorithms
A brief overview
NXT-G is a programming language designed to help students and adults alike easily and quickly become familiar with
programming.
The following exercise is designed to give you a quick introduction to programming as well as to understand your
quick grasp of programming ideas. Attached to “Pleo” images are questions. In the boxes, please write
your answers.
Pleo the Dinosaur Robot.
Figure 1: Image source: http://images.amazon.com/images/G/01/electronics/detail-page/B000RWEGCO-2-med.jpg
Imagine that Pleo is your personal pet dinosaur robot. Pleo understands GO, FORWARD, BACKWARD, TURN,
LEFT, RIGHT, FEET, and STOP. When you say “GO FORWARD 3 FEET”, Pleo goes forward 3 feet as Pleo understands
numbers. When you say “TURN LEFT”, Pleo turns left.
Problem 1:
When you say “GO HOME”, Pleo does not respond. WHY?
Problem 2:
Pleo is in my living room. We are expecting visitors and my mom would like me to clean the living room
and put Pleo in my bedroom. Pleo is heavy but good at following directions. Can you help me by giving
him directions to my bedroom?
Problem 3:
What will happen if when Pleo is in my living room, I give him directions “GO FORWARD 12 FEET”?
Problem 4: Living-room: A program:
The next day my mom says, “Your room is a mess, clean up your room.” And this goes on and on. Pleo
moves between the living room and dining room, and I get tired of giving him instructions. I looked up
the manual and found that I could teach Pleo new words and write a “program” in the language that he understands.
I have to be careful, for the language Pleo understands is more than words, there is a specific rule to put the words
together.
How can I write “Living-room” a program that contains a series of instructions to move Pleo from my bedroom to the
living room?
The above exercises present a logical flow of sequence or instructions that a program, or in this case, a robot should
follow. The steps as written represent an algorithm, which closely resembles the English language.Than
Color of
the ball
Is
False
True
Introduction to flowcharts
A flowchart is a graphical representation of an algorithm. A flowchart shows the sequential flow of process a
program, or in this case, a robot should follow. Flowcharts play a vital role in the programming of a problem and are
quite helpful in understanding the logic of complicated and lengthy problems. Flowcharts support the programming
of an idea and are not specific to a given computer programing language. In addition, they are a quick and powerful
visual tool. Thus a flowchart is a preferred documentation of any program.
Flowcharts are usually drawn using some standard symbols; however,
Start or end of the program
Steps to be executed
Input or output operation, used to refer to data and sensorial input
Decision making and branching, is usually a true or false
Connector or joining of two parts of program, especially useful in long
programs
The accepted guidelines in flowcharting are:
a. Logical sequence should be followed.
b. The usual direction of the flow of a procedure or system is from left to right or top to bottom.
c. Only one flow line should go into and come out from a process symbol, connector, or input/output.
or
e. Only one flow line can enter a decision symbol, but
two or three flow lines, one for each possible answer,
should leave the decision symbol.
f. Only one flow line is used in conjunction with terminal
symbol.
Examples of flowchart
1. Move forward 10 steps
 In this flowchart, what is the first action that our robot will do?
 If the robot has completed 10 steps, what will the robot do?
2. Sort the ball by color
 In this program, what will happen when the robot sees a red ball?
 In this program, what will happen when the robot sees a green ball?
 In this program, what will happen when the robot sees a blue ball?
 What modification does your program need to sort the balls accurately?
 What modification does your program need to sort the balls repeatedly?
Start Move forward
1 step
Forward
10 steps?
Stop
Yes
No
Start Is the ball
blue?
Yes
No
Read ball
color Store left
Store right
Repetition of a certain set of commands
The driver of the bus drives to a stop. At the stop he issues tickets to the passengers. Then the driver proceeds to the
next stop and repeats the process from the first to the last stop. The following flowchart shows how a set of
repeated conditions are contained within a set of commands.
Decision based on 2 or more criteria
Many programs draw decisions on multiple criteria which happen in parallel. A train can leave the station when all
passengers have boarded or the train has remained at the stop for 30 seconds. How can the given situation be
depicted in a flowchart?
The response can be summed up as an either/or algorithm:
 Go to next station
 If passengers have boarded or if train has stopped at the station for 30 seconds, move to next station.
Complete the instructions for this flowchart by:
Start
Go to next
stop
Passenger?
Issue
ticket
Last stop
Yes
Yes
No
No
Stop
Start ????????? Either/or
condition
Stop
Yes
No
1. Setting up a timer input
2. Setting up the sensor input to check on the passengers.

Mais conteúdo relacionado

Destaque

Gears: Lego Mindstorms
Gears: Lego MindstormsGears: Lego Mindstorms
Gears: Lego Mindstormsasrctw
 
What happened to Gaza during the 1967 war?
What happened to Gaza during the 1967 war?What happened to Gaza during the 1967 war?
What happened to Gaza during the 1967 war?Ahmed Al Qarot
 
October War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic SurpriseOctober War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic SurpriseW. Troy Ayres
 
Us involvement in the vietnam war 1
Us involvement in the vietnam war 1Us involvement in the vietnam war 1
Us involvement in the vietnam war 1lguntup
 
D3 (drought management and risk reduction in pakistan) brig. kamran shariff
D3 (drought management and risk reduction in pakistan)  brig. kamran shariffD3 (drought management and risk reduction in pakistan)  brig. kamran shariff
D3 (drought management and risk reduction in pakistan) brig. kamran shariffmuneeb khalid khalid muneeb
 
The Social Corporate Revolution
The Social Corporate Revolution   The Social Corporate Revolution
The Social Corporate Revolution Stefano Mizzella
 
Technical Properties of A Nuclear Power Plant
Technical Properties of A Nuclear Power PlantTechnical Properties of A Nuclear Power Plant
Technical Properties of A Nuclear Power PlantCan Görkem Ünal
 
1948 Arab–Israeli
1948 Arab–Israeli1948 Arab–Israeli
1948 Arab–Israelijakblack
 
Topic.09 The Civil Rights Movement
Topic.09 The Civil Rights MovementTopic.09 The Civil Rights Movement
Topic.09 The Civil Rights Movementmr.meechin
 
Nuclear power
Nuclear powerNuclear power
Nuclear powerAparna
 
Similarities
SimilaritiesSimilarities
Similaritiesippnw
 
Cold war Photo Essay World History
Cold war Photo Essay World HistoryCold war Photo Essay World History
Cold war Photo Essay World HistoryTorresTroll
 
Report on HISTORY OF MONEY IN CHINA
Report on HISTORY OF MONEY IN CHINAReport on HISTORY OF MONEY IN CHINA
Report on HISTORY OF MONEY IN CHINATayyab Farooq
 
Heroines And Heroes Of Sindh Long March
Heroines And Heroes Of Sindh Long MarchHeroines And Heroes Of Sindh Long March
Heroines And Heroes Of Sindh Long Marchguestf7ae21
 
Algorithms Vs Meta Language
Algorithms Vs Meta LanguageAlgorithms Vs Meta Language
Algorithms Vs Meta LanguageKelly Bauer
 
Inventions: The computer
Inventions: The computerInventions: The computer
Inventions: The computerandreasupertino
 

Destaque (20)

Gears: Lego Mindstorms
Gears: Lego MindstormsGears: Lego Mindstorms
Gears: Lego Mindstorms
 
What happened to Gaza during the 1967 war?
What happened to Gaza during the 1967 war?What happened to Gaza during the 1967 war?
What happened to Gaza during the 1967 war?
 
October War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic SurpriseOctober War_Effective Egyptian Preprarations Enable Strategic Surprise
October War_Effective Egyptian Preprarations Enable Strategic Surprise
 
Us involvement in the vietnam war 1
Us involvement in the vietnam war 1Us involvement in the vietnam war 1
Us involvement in the vietnam war 1
 
D3 (drought management and risk reduction in pakistan) brig. kamran shariff
D3 (drought management and risk reduction in pakistan)  brig. kamran shariffD3 (drought management and risk reduction in pakistan)  brig. kamran shariff
D3 (drought management and risk reduction in pakistan) brig. kamran shariff
 
The Social Corporate Revolution
The Social Corporate Revolution   The Social Corporate Revolution
The Social Corporate Revolution
 
WWI 5 Weapons
WWI 5 WeaponsWWI 5 Weapons
WWI 5 Weapons
 
Technical Properties of A Nuclear Power Plant
Technical Properties of A Nuclear Power PlantTechnical Properties of A Nuclear Power Plant
Technical Properties of A Nuclear Power Plant
 
1948 Arab–Israeli
1948 Arab–Israeli1948 Arab–Israeli
1948 Arab–Israeli
 
Topic.09 The Civil Rights Movement
Topic.09 The Civil Rights MovementTopic.09 The Civil Rights Movement
Topic.09 The Civil Rights Movement
 
Lesson 3 fundamentalism
Lesson 3   fundamentalismLesson 3   fundamentalism
Lesson 3 fundamentalism
 
Nuclear power
Nuclear powerNuclear power
Nuclear power
 
27 NP Completness
27 NP Completness27 NP Completness
27 NP Completness
 
Similarities
SimilaritiesSimilarities
Similarities
 
Cold war Photo Essay World History
Cold war Photo Essay World HistoryCold war Photo Essay World History
Cold war Photo Essay World History
 
Hemp History China
Hemp History ChinaHemp History China
Hemp History China
 
Report on HISTORY OF MONEY IN CHINA
Report on HISTORY OF MONEY IN CHINAReport on HISTORY OF MONEY IN CHINA
Report on HISTORY OF MONEY IN CHINA
 
Heroines And Heroes Of Sindh Long March
Heroines And Heroes Of Sindh Long MarchHeroines And Heroes Of Sindh Long March
Heroines And Heroes Of Sindh Long March
 
Algorithms Vs Meta Language
Algorithms Vs Meta LanguageAlgorithms Vs Meta Language
Algorithms Vs Meta Language
 
Inventions: The computer
Inventions: The computerInventions: The computer
Inventions: The computer
 

Semelhante a Introduction to flowcharts and algorithms

Coding io1--materials for students-group6
Coding io1--materials for students-group6Coding io1--materials for students-group6
Coding io1--materials for students-group6Georgeta Manafu
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithmsStudent
 
compatibility and complexity in the IS.ppt
compatibility and complexity in the IS.pptcompatibility and complexity in the IS.ppt
compatibility and complexity in the IS.pptMuhammadAbdullah311866
 
10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechzShahbaz Ahmad
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingHamad Odhabi
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchartdipti reya
 
GRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptxGRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptxAllanGuevarra1
 
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptxChallenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptxRusherGamer1
 
Getting Started with Robotics
Getting Started with RoboticsGetting Started with Robotics
Getting Started with Roboticss0133116
 
The secret of Functional Programming revealed!
The secret of Functional Programming revealed!The secret of Functional Programming revealed!
The secret of Functional Programming revealed!Torbjørn Marø
 
Small Basic Calculator Apps lesson
Small Basic Calculator Apps lessonSmall Basic Calculator Apps lesson
Small Basic Calculator Apps lessonEdujetage
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review GuideBenjamin Kissinger
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsRuth Marvin
 
Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...
Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...
Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...Lucky Gods
 

Semelhante a Introduction to flowcharts and algorithms (20)

Introductoin to Python.ppt
Introductoin to Python.pptIntroductoin to Python.ppt
Introductoin to Python.ppt
 
Coding io1--materials for students-group6
Coding io1--materials for students-group6Coding io1--materials for students-group6
Coding io1--materials for students-group6
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithms
 
Interm Progr
Interm ProgrInterm Progr
Interm Progr
 
compatibility and complexity in the IS.ppt
compatibility and complexity in the IS.pptcompatibility and complexity in the IS.ppt
compatibility and complexity in the IS.ppt
 
10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz
 
ForLoops.pptx
ForLoops.pptxForLoops.pptx
ForLoops.pptx
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
GRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptxGRADE 6 ALGORITHM.pptx
GRADE 6 ALGORITHM.pptx
 
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptxChallenges-and-Consideration-in-Programming-Logic-and-Design...pptx
Challenges-and-Consideration-in-Programming-Logic-and-Design...pptx
 
Getting Started with Robotics
Getting Started with RoboticsGetting Started with Robotics
Getting Started with Robotics
 
Lab a
Lab aLab a
Lab a
 
The secret of Functional Programming revealed!
The secret of Functional Programming revealed!The secret of Functional Programming revealed!
The secret of Functional Programming revealed!
 
Small Basic Calculator Apps lesson
Small Basic Calculator Apps lessonSmall Basic Calculator Apps lesson
Small Basic Calculator Apps lesson
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review Guide
 
Mastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loopsMastering Python lesson3b_for_loops
Mastering Python lesson3b_for_loops
 
Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...
Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...
Mastering Python : 100+ Solved and Commented Exercises to Accelerate Your Lea...
 
Introducing Scratch
Introducing ScratchIntroducing Scratch
Introducing Scratch
 

Último

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 

Último (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 

Introduction to flowcharts and algorithms

  • 1. Flowcharts and Algorithms A brief overview NXT-G is a programming language designed to help students and adults alike easily and quickly become familiar with programming. The following exercise is designed to give you a quick introduction to programming as well as to understand your quick grasp of programming ideas. Attached to “Pleo” images are questions. In the boxes, please write your answers. Pleo the Dinosaur Robot. Figure 1: Image source: http://images.amazon.com/images/G/01/electronics/detail-page/B000RWEGCO-2-med.jpg Imagine that Pleo is your personal pet dinosaur robot. Pleo understands GO, FORWARD, BACKWARD, TURN, LEFT, RIGHT, FEET, and STOP. When you say “GO FORWARD 3 FEET”, Pleo goes forward 3 feet as Pleo understands numbers. When you say “TURN LEFT”, Pleo turns left. Problem 1: When you say “GO HOME”, Pleo does not respond. WHY?
  • 2. Problem 2: Pleo is in my living room. We are expecting visitors and my mom would like me to clean the living room and put Pleo in my bedroom. Pleo is heavy but good at following directions. Can you help me by giving him directions to my bedroom?
  • 3. Problem 3: What will happen if when Pleo is in my living room, I give him directions “GO FORWARD 12 FEET”? Problem 4: Living-room: A program: The next day my mom says, “Your room is a mess, clean up your room.” And this goes on and on. Pleo moves between the living room and dining room, and I get tired of giving him instructions. I looked up the manual and found that I could teach Pleo new words and write a “program” in the language that he understands. I have to be careful, for the language Pleo understands is more than words, there is a specific rule to put the words together. How can I write “Living-room” a program that contains a series of instructions to move Pleo from my bedroom to the living room? The above exercises present a logical flow of sequence or instructions that a program, or in this case, a robot should follow. The steps as written represent an algorithm, which closely resembles the English language.Than
  • 4. Color of the ball Is False True Introduction to flowcharts A flowchart is a graphical representation of an algorithm. A flowchart shows the sequential flow of process a program, or in this case, a robot should follow. Flowcharts play a vital role in the programming of a problem and are quite helpful in understanding the logic of complicated and lengthy problems. Flowcharts support the programming of an idea and are not specific to a given computer programing language. In addition, they are a quick and powerful visual tool. Thus a flowchart is a preferred documentation of any program. Flowcharts are usually drawn using some standard symbols; however, Start or end of the program Steps to be executed Input or output operation, used to refer to data and sensorial input Decision making and branching, is usually a true or false Connector or joining of two parts of program, especially useful in long programs The accepted guidelines in flowcharting are: a. Logical sequence should be followed. b. The usual direction of the flow of a procedure or system is from left to right or top to bottom. c. Only one flow line should go into and come out from a process symbol, connector, or input/output. or e. Only one flow line can enter a decision symbol, but two or three flow lines, one for each possible answer, should leave the decision symbol. f. Only one flow line is used in conjunction with terminal symbol.
  • 5. Examples of flowchart 1. Move forward 10 steps  In this flowchart, what is the first action that our robot will do?  If the robot has completed 10 steps, what will the robot do? 2. Sort the ball by color  In this program, what will happen when the robot sees a red ball?  In this program, what will happen when the robot sees a green ball?  In this program, what will happen when the robot sees a blue ball?  What modification does your program need to sort the balls accurately?  What modification does your program need to sort the balls repeatedly? Start Move forward 1 step Forward 10 steps? Stop Yes No Start Is the ball blue? Yes No Read ball color Store left Store right
  • 6. Repetition of a certain set of commands The driver of the bus drives to a stop. At the stop he issues tickets to the passengers. Then the driver proceeds to the next stop and repeats the process from the first to the last stop. The following flowchart shows how a set of repeated conditions are contained within a set of commands. Decision based on 2 or more criteria Many programs draw decisions on multiple criteria which happen in parallel. A train can leave the station when all passengers have boarded or the train has remained at the stop for 30 seconds. How can the given situation be depicted in a flowchart? The response can be summed up as an either/or algorithm:  Go to next station  If passengers have boarded or if train has stopped at the station for 30 seconds, move to next station. Complete the instructions for this flowchart by: Start Go to next stop Passenger? Issue ticket Last stop Yes Yes No No Stop Start ????????? Either/or condition Stop Yes No
  • 7. 1. Setting up a timer input 2. Setting up the sensor input to check on the passengers.