Welcome back to Software Development!

Slides:



Advertisements
Similar presentations
Working With Algorithm and Flowcharts
Advertisements

COMPUTER PROGRAMMING I Understand Problem Solving Tools to Design Programming Solutions.
Reference :Understanding Computers
ME 142 Engineering Computation I Fundamentals of Procedural Computer Programming.
Basics of Computer Programming Web Design Section 8-1.
8 Algorithms Foundations of Computer Science ã Cengage Learning.
D1: Quick Sort. The quick sort is an algorithm that sorts data into a specified order. For a quick sort, select the data item in the middle of the list.
CMPS1371 Introduction to Computing for Engineers SORTING.
Chapter 2- Visual Basic Schneider
The Program Design Phases
Lecture # 8 ALGORITHMS AND FLOWCHARTS. Algorithms The central concept underlying all computation is that of the algorithm ◦ An algorithm is a step-by-step.
By the end of this session you should be able to...
Simple Iterative Sorting Sorting as a means to study data structures and algorithms Historical notes Swapping records Swapping pointers to records Description,
Visual Basic Programming
A note on oral presentations These are the progress report presentations. Please note that the individual presentations should be ~8 min long. Since the.
To know and use the Bubble Sort and Shuttle Sort Algorithms.
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.
Title Slide Progress Report Name. Goal Goal Statement – ex. design/create/fabricate … - should be clear and short Needs/Problems – clear and short Space.
ALGORITHMS.
It’s Time to Write a strong Thesis Statement! Packet #3 Working Thesis.
8.1 8 Algorithms Foundations of Computer Science  Cengage Learning.
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
Introduction to Algorithms. Algorithms Algorithms are ways of solving problems. There is a technical definition that basically says an algorithm is a.
By the end of this session you should be able to... Understand what is meant by ‘thinking logically’ including: Identify the points in a solution where.
Learning outcomes 5 Developing Code – Using Flowcharts
Understand Problem Solving Tools to Design Programming Solutions
CS1010 Programming Methodology
Responsibilities CS 4501 / 6501 Software Testing
3.1 Fundamentals of algorithms
FLOWCHARTS Part 1.
Basics of Computer Programming
Problem Solving How do we attack a large problem?
IGCSE 6 Cambridge Effectiveness of algorithms Computer Science
7/14/16 CTC-RI IBH Pilot Quarterly Meeting
Introduction to Computing
CS 106 Computing Fundamentals II Chapter 77 “Algorithm”
3.1 Algorithms (and real programming examples).
Introduction to Programming
Understand Problem Solving Tools to Design Programming Solutions
Unit 2 Smarter Programming.
Lecture 2 Introduction to Programming
Introduction to Programmng in Python
Basics of Computer Programming
Basics of Computer Programming
Basics of Computer Programming
Creating Flowcharts AIM:
Sitton Spelling Refresher
How to Correct a Quiz or Test
Unit# 9: Computer Program Development
Last Class We Covered Data representation Binary numbers ASCII values
Designing an Algorithm
“Human Sorting” It’s a “Problem Solving” game:
Last Class We Covered Dictionaries Hashing Dictionaries vs Lists
Sorting … and Insertion Sort.
Introduction to Algorithms and Programming
ME 142 Engineering Computation I
My Take on the Largest Number Algorithm
No Yes START Do you live in Scotland? Take umbrella See last Flowchart
Welcome back to Software Development!
Start or end of algorithm: Action/process step:
Test Plans Making the world safe for software
Welcome back to Software Development!
Welcome back to Software Development!
Algorithm “Quiz”.
“Human Sorting” It’s a “Problem Solving” game:
Applications of Arrays
Chapter 1: Creating a Program.
Sorting and selection Prof. Noah Snavely CS1114
Presentation transcript:

Welcome back to Software Development! Return graded assignments Review classroom procedures: Start of class procedure Reminders: Missing assignments Friday quiz – open book

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 Is the stoplight red? Yes No

Largest Number Algorithm Take the 1st number – at the start, it is the largest we’ve seen Do 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 Until there are no more numbers left The number you are left with is the largest

Get 1st # as largest Get nxt # Compare nxt to largest Nxt # larger? Yes Nxt is new largest No Flowchart for my algo Emphasize Loop is obvious Decisions are obvious Loop termination condition…end of list General…works for any list of numbers Only specific is starting in the list (1st item in list) More #’s ? Yes No Done!

Task: find the largest number in a list of integers

Task: find the largest number in a list of integers Possible Algorithm:

Task: find the largest number in a list of integers Possible Algorithm: Get the list

Task: find the largest number in a list of integers Possible Algorithm: Get the list Get the biggest number from the list

Task: find the largest number in a list of integers Possible Algorithm: Get the list Get the biggest number from the list Done

Task: find the largest number in a list of integers Possible Algorithm: Get the list Get the biggest number from the list Done

Task: find the largest number in a list of integers Possible Algorithm: Get the list Get the biggest number from the list Done All you are doing is restating the problem…

Task: find the largest number in a list of integers

Task: find the largest number in a list of integers Algorithm:

Task: find the largest number in a list of integers Algorithm: Get the list

Task: find the largest number in a list of integers Algorithm: Get the list Sort the list from smallest to largest

Task: find the largest number in a list of integers Algorithm: Get the list Sort the list from smallest to largest Take the largest number

Task: find the largest number in a list of integers Algorithm: Get the list Sort the list from smallest to largest Take the largest number Done

Task: find the largest number in a list of integers Algorithm: Get the list Sort the list from smallest to largest Take the largest number Done

Task: find the largest number in a list of integers Algorithm: Get the list Sort the list from smallest to largest Take the largest number Done

Task: find the largest number in a list of integers Algorithm: Get the list Sort the list from smallest to largest Take the largest number Done You’ve actually created a harder problem that includes this one!

Algorithm Guidelines…

Algorithm Guidelines… One action per step or flowchart box:

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box?

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box.

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box. Conjunction Junction…

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box. Conjunction Junction… And, or, but, unless, ...

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box. Conjunction Junction… And, or, but, unless, ... Likely more than one action in the step.

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box. Conjunction Junction… And, or, but, unless, ... Likely more than one action in the step. Look for buried questions or decisions

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box. Conjunction Junction… And, or, but, unless, ... Likely more than one action in the step. Look for buried questions or decisions Looping words: continue, do, repeat (the flow arrows covers these)

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box. Conjunction Junction… And, or, but, unless, ... Likely more than one action in the step. Look for buried questions or decisions Looping words: continue, do, repeat (the flow arrows covers these) Decision words: is, if, ?

Algorithm Guidelines… One action per step or flowchart box: Too many words in the step / box? Keep it short and sweet … 5-6 words per step / box. Conjunction Junction… And, or, but, unless, ... Likely more than one action in the step. Look for buried questions or decisions Looping words: continue, do, repeat (the flow arrows covers these) Decision words: is, if, ? “Keep the larger number” is a decision (if x > y) and an action (keep x)…2 steps

Broken down enough?

Broken down enough? Swap “this” and “that” number in the list

Broken down enough? Swap “this” and “that” number in the list Is this one step?

Broken down enough? Swap “this” and “that” number in the list Is this one step? Actually no…

Broken down enough? Swap “this” and “that” number in the list Is this one step? Actually no… 1) Get a temporary copy of “this” number

Broken down enough? Swap “this” and “that” number in the list Is this one step? Actually no… 1) Get a temporary copy of “this” number 2) Move “that” number to “this” number’s slot

Broken down enough? Swap “this” and “that” number in the list Is this one step? Actually no… 1) Get a temporary copy of “this” number 2) Move “that” number to “this” number’s slot 3) Move “this” number to “that” number’s old slot

Broken down enough? Swap “this” and “that” number in the list Is this one step? Actually no… 1) Get a temporary copy of “this” number 2) Move “that” number to “this” number’s slot 3) Move “this” number to “that” number’s old slot If you understand this, you can put “swap A with B” as a flowchart step

Broken down enough? Swap “this” and “that” number in the list Is this one step? Actually no… 1) Get a temporary copy of “this” number 2) Move “that” number to “this” number’s slot 3) Move “this” number to “that” number’s old slot If you understand this, you can put “swap A with B” as a flowchart step When you code it, you will need to actually code the above steps

Practice Guided practice Rewrite “largest number” algo Focus on general solution Loop termination condition Flowchart your algo Team effort Turn in at end of class…graded. FINISH ALGO BEFORE STARTING FLOWCHART! About 30 mins

Practice Review and rewrite your “select the largest number” algorithm for clarity and conciseness.

Practice Review and rewrite your “select the largest number” algorithm for clarity and conciseness. Flowchart your “select the largest number” algorithm.

Practice Review and rewrite your “select the largest number” algorithm for clarity and conciseness. Flowchart your “select the largest number” algorithm. You have 30 minutes…

Hmm, an idea… Demonstrate power of a general algo Simple change solves a different problem What change needed to find smallest number? 10 minutes, group work

Hmm, an idea… What would you have to do to your “largest number” algorithm to make it a “smallest number” algorithm?

Hmm, an idea… What would you have to do to your “largest number” algorithm to make it a “smallest number” algorithm? Just change your comparison decision!

A Harder Task Extend and reinforce power of general solution. Use either algos to develop algo to sort a list of numbers Tool box reminder: Algos are tools to be used Keep a “tool box” of your valuable tools Use the right tool for the job Rest of class (30 minute goal) Close with “clear/unclear windows”

A Harder Task See if you can find a way to use your “largest number” or “smallest number” algorithm to sort a (any) list of numbers.

A Harder Task See if you can find a way to use your “largest number” or “smallest number” algorithm to sort a (any) list of numbers. Work with your partner

A Harder Task See if you can find a way to use your “largest number” or “smallest number” algorithm to sort a (any) list of numbers. Work with your partner Names on your work paper

A Harder Task See if you can find a way to use your “largest number” or “smallest number” algorithm to sort a (any) list of numbers. Work with your partner Names on your work paper Turn in at end of class

A Harder Task See if you can find a way to use your “largest number” or “smallest number” algorithm to sort a (any) list of numbers. Work with your partner Names on your work paper Turn in at end of class You have about 30 minutes…

Clear and Unclear Windows Tomorrow: Continue sorting algo Loops exploration