My Take on the Largest Number Algorithm

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

Flow Chart.
CS 240 Computer Programming 1
1 1 Eng. Mohamed Eltaher Eng.Ahmed Ibrahim Programming & Flowchart.
PSEUDOCODE & FLOW CHART
Flow Control Analysis & Design Tool: Flowcharts
Reference :Understanding Computers
Chapter 1 Pseudocode & Flowcharts
Fundamentals of Algorithms MCS - 2 Lecture # 4
Basics of Computer Programming Web Design Section 8-1.
Flow Chart.
Chapter 2- Visual Basic Schneider
Flowchart Diagram Risanuri Hidayat. What A Flow Chart is a sequential diagram that shows the steps involved in an operation or task and the decisions.
Chapter 3 Planning Your Solution
The Program Design Phases
Chapter 1 Pseudocode & Flowcharts
Lecture # 8 ALGORITHMS AND FLOWCHARTS. Algorithms The central concept underlying all computation is that of the algorithm ◦ An algorithm is a step-by-step.
Flowchart IDT. What is a flowchart? Visual representation of a flow of data Outline of process or a solution to a problem Outline the basic logic behind.
Flowcharting A Quality Improvement Tool. Quality = Inspection Statistical methods assisted in prevention of defects – The need for inspection declined.
Basic problem solving CSC 111.
Chapter 1 Pseudocode & Flowcharts
Program Design BUILDING A HOUSE. Steps to Designing a Program 1. Define the Output 2. Develop the logic to get that output 3. Write the program.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Flowcharts. Learning Objectives To learn how to break down tasks How to create a flowchart.
Large Digital Systems. Outline  Large Digital Systems  Top-Down Approach  Controller and Data Processor  Flowcharts.
FLOWCHARTING AND ALGORITHMS
Flow Charts. Flow charts A flowchart is a schematic (idea of doing something) representation of a process. They are commonly used in Computer Science.
Lecture 3: Logic Bryan Burlingame 06 Sept 2017.
Understand Problem Solving Tools to Design Programming Solutions
Flowchart Symbols Terminal Process Input/ Output Decision
FLOWCHARTS Part 1.
Basics of Computer Programming
Flowcharting Guidelines
Chapter 2- Visual Basic Schneider
Understand Problem Solving Tools to Design Programming Solutions
Teaching design techniques to design efficient solutions to problems
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
Lecture 2 Introduction to Programming
Introduction To Flowcharting
Numbering System TODAY AND TOMORROW 11th Edition
Basics of Computer Programming
What is a Flow Chart? An organized combination of shapes, lines, and text that graphically illustrates a process or structure A pictorial representation.
What is a Flow Chart ? An organized combination of shapes, lines, and text that graphically illustrates a process or structure A pictorial representation.
Basics of Computer Programming
Basics of Computer Programming
Programming Logic n Techniques
ALGORITHMS AND FLOWCHARTS
Algorithms Y10 Introduction.
Chapter 1 Pseudocode & Flowcharts
Unit# 9: Computer Program Development
Structured Program Design
ALGORITHMS AND FLOWCHARTS
Chapter 2- Visual Basic Schneider
Chapter 1 Pseudocode & Flowcharts
Introduction to Algorithms and Programming
Faculty of Computer Science & Information System
Chapter 2- Visual Basic Schneider
ME 142 Engineering Computation I
How Are Algorithms Developed?
No Yes START Do you live in Scotland? Take umbrella See last Flowchart
Flowcharts and Pseudo Code
Start or end of algorithm: Action/process step:
Welcome back to Software Development!
Welcome back to Software Development!
Developing a Program.
Chapter 1 Pseudocode & Flowcharts
Presentation transcript:

My Take on the Largest Number Algorithm My take on “largest number” algo… Follow and compare to yours Explain basic flow Then fill in loop… Make sure they see the loop as a separate thing Make sure they see loop termination condition General solution Examine limiting techniques teams tried: # digits in number Enumerating specific numbers Only allowing for positive # Only allowing for integers Algo must be general … work for *ANY* list of numbers Becomes a general tool Reuse Easily extended/changed

My Take on the Largest Number Algorithm Take the 1st number

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left 5

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left <stuff> 6

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left 7

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list 8

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list Compare the current largest to the next number 9

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list Compare the current largest to the next number If the next number is larger 10

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list Compare the current largest to the next number If the next number is larger Then take it as the largest 11

My Take on the Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list Compare the current largest to the next number If the next number is larger Then take it as the largest The number you are left with is the largest 12

My Take on the Largest Number Algorithm 1) Initialize – get set up Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list Compare the current largest to the next number If the next number is larger Then take it as the largest The number you are left with is the largest 13

My Take on the Largest Number Algorithm 1) Initialize – get set up Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list Compare the current largest to the next number If the next number is larger Then take it as the largest The number you are left with is the largest 2) Repeated steps - loop 14

My Take on the Largest Number Algorithm 1) Initialize – get set up Take the 1st number – at the start, it is the largest we’ve seen While you have numbers left Get the next number from the list Compare the current largest to the next number If the next number is larger Then take it as the largest The number you are left with is the largest 3) Finish – how to exit the loop 2) Repeated steps - loop 15

Visualizing Your Design

Visualizing Your Algorithm

Visualizing Your Algorithm Writing it out in English can get cumbersome

Visualizing Your Algorithm Writing it out in English can get cumbersome Seeing the flow of the algorithm can be almost impossible

Visualizing Your Algorithm Writing it out in English can get cumbersome Seeing the flow of the algorithm can be almost impossible What would be nice is a graphical way of representing the algorithm

Visualizing Your Algorithm Writing it out in English can get cumbersome Seeing the flow of the algorithm can be almost impossible What would be nice is a graphical way of representing the algorithm Flowcharts are here to save the day!

Flowchart to print the sum of the first 50 natural numbers

Flowchart to print the sum of the first 50 natural numbers

A more complicated example for troubleshooting CD or DVD playback problems.

A more complicated example for troubleshooting CD or DVD playback problems.

Basic Flowchart Symbols

Basic Flowchart Symbols Start or end of algorithm

Basic Flowchart Symbols Start or end of algorithm:

Basic Flowchart Symbols Start or end of algorithm:

Basic Flowchart Symbols Start or end of algorithm: Leave the house

Basic Flowchart Symbols Start or end of algorithm: Leave the house At school - done

Basic Flowchart Symbols Start or end of algorithm: Action/process step Leave the house At school - done

Basic Flowchart Symbols Start or end of algorithm: Action/process step: Leave the house At school - done

Basic Flowchart Symbols Start or end of algorithm: Action/process step: Leave the house At school - done Start the car

Basic Flowchart Symbols Start or end of algorithm: Action/process step: Input or output operation Leave the house At school - done Start the car

Basic Flowchart Symbols Start or end of algorithm: Action/process step: Input or output operation: Leave the house At school - done Start the car

Basic Flowchart Symbols Start or end of algorithm: Action/process step: Input or output operation: Leave the house At school - done Start the car Ask for directions

Basic Flowchart Symbols Start or end of algorithm: Action/process step: Input or output operation: Decision Leave the house At school - done Start the car Ask for directions

Basic Flowchart Symbols Start or end of algorithm: Action/process step: Input or output operation: Decision: Leave the house At school - done Start the car Ask for directions Yes No

Basic Flowchart Symbols

Basic Flowchart Symbols Connect the boxes with arrows to show logic/process flow.

Basic Flowchart Symbols Connect the boxes with arrows to show logic/process flow. Try to keep things lined up and “clean”.

Basic Flowchart Symbols

Basic Flowchart Symbols If you run out of room on a page:

Basic Flowchart Symbols If you run out of room on a page: Try to keep logical things together on the same page.

Basic Flowchart Symbols If you run out of room on a page: Try to keep logical things together on the same page. Connect flow from page to page with a connector symbol:

Basic Flowchart Symbols If you run out of room on a page: Try to keep logical things together on the same page. Connect flow from page to page with a connector symbol: 1 Do some stuff

Basic Flowchart Symbols If you run out of room on a page: Try to keep logical things together on the same page. Connect flow from page to page with a connector symbol: 1 Do some stuff 1 Do some more stuff

Practice

Practice Flowchart your “select the largest number” algorithm.

Practice Flowchart your “select the largest number” algorithm. Work on refining your “put clothes away” algorithm.

Practice Flowchart your “select the largest number” algorithm. Work on refining your “put clothes away” algorithm. Flowchart your “put clothes away” algorithm.

Clear and Unclear Windows