Design a Problem Solution. Making a design In this class we use the words “design”, “pseudocode” and “algorithm” interchangeably These are steps to solve.

Slides:



Advertisements
Similar presentations
Algorithms Series of mathematical or variable manipulations Integer a,b,c a = 12 b = 22 c = a * b (what is c?) 12 * 22 = 264.
Advertisements

Why python? Automate processes Batch programming Faster Open source Easy recognition of errors Good for data management What is python? Scripting programming.
ECATS “The Honeywell Web-based Corrective Action Solution” CAR Process Last Revised: August 19 th 2008 Honeywell Confidential & Proprietary.
Program Design and Development
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
Chapter 1 Program Design
BBS Yapısal Programlama (Structured Programming)1 From problem to program In “real world”… Problem in Natural language Top Down Design in pseudo-code.
Chapter 3 Planning Your Solution
5.8m Solar House Installation Instruction. Introduction Step 1. connect the corner panels Step 2. connect the back and side wall panels Step 3. Install.
House Construction. Learning Standard 5. Construction Technologies Construction technology involves building structures in order to contain, shelter,
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Unit B065 – Coding a solution PREP WORK 1)Make sure you keep a work log / diary. Use the table on page 16 of the hand book as a template 2)Keep a bibliography.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
Introduction to Algorithm Design and Documentation CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #002 (January 17, 2015)
Python File Handling. In all the programs you have made so far when program is closed all the data is lost, but what if you want to keep the data to use.
CHAPTER 1: INTRODUCTION TO COMPUTER SCIENCE Introduction to Computer Science Using Ruby (c) 2012 Ophir Frieder et al.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Python From the book “Think Python”
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Python Repetition. We use repetition to prevent typing the same code out many times and to make our code more efficient. FOR is used when you know how.
Lesson 4 Using Variables in Python – Creating a Simple ChatBot Program.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
Sequencing The most simple type of program uses sequencing, a set of instructions carried out one after another. Start End Display “Computer” Display “Science”
Intermediate 2 Computing Unit 2 - Software Development.
Putting Together the Science Fair Logbook
The Hashemite University Computer Engineering Department
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
A Python Tour: Just a Brief Introduction "The only way to learn a new programming language is by writing programs in it." -- B. Kernighan and D. Ritchie.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
Files in Python The Basics. Why use Files? Very small amounts of data – just hardcode them into the program A few pieces of data – ask the user to input.
Comments, Conditional Statements Continued, and Loops Engineering 1D04, Teaching Session 4.
Doghouse start Mrs. Hallman – Project lead the Way.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Programming with Miracle. Goals of Miracle ● Concentrate on key ideas in programming ● Reduce concerns about syntax ● Assist in development of code ●
Repetition In today’s lesson we will look at: why you would want to repeat things in a program different ways of repeating things creating loops in Just.
Programming In Python. Starter Using the internet… Find what a programming language is.
Getting Started With Python Brendan Routledge
Introduction to Problem Solving Programming is a problem solving activity. When you write a program, you are actually writing an instruction for the computer.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
Starter What does the following code do?
Development Environment
A Python Tour: Just a Brief Introduction
A451 Theory – 7 Programming 7A, B - Algorithms.
Introduction to Programming
Algorithms IV Top-Down Design.
CSE101-Lec#2 Programming Methodologies
An Introduction to Programming and VB.NET
Problem Solving Techniques
Learning to Program in Python
Python I/O.
exa.im/stempy16.files - Session 12 Python Camp
Week 1 Computer Programming Year 9 – Unit 9.04
Introduction to TouchDevelop
Introduction to Programming
Input and Output Python3 Beginner #3.
Introduction to Python
Introduction to Programming
Starter Which of these inventions is: Used most by people in Britain
Putting Together the Science Fair Logbook
Introduction to Programming
Presentation transcript:

Design a Problem Solution

Making a design In this class we use the words “design”, “pseudocode” and “algorithm” interchangeably These are steps to solve a problem, they involve writing down a design for the solution A design is similar to a rough draft or an outline for an essay It’s meant to be a thinking tool, it will not be neat. You will make corrections, additions, deletions, reorderings

Problem – build a dog house

Building a dog house 1.decide on location for house 2.decide on size of house 3.get plans for house 4.get materials for house 5.cut wood for bottom of house 6.put bottom platform together 7.cut wood for 4 walls of house 8.assemble walls 9.attach walls to bottom 10.cut door 11.make roof 12.attach roof to walls 13.paint outside

Notes about the design The steps are numbered in the order they will be done – we will ask you to do that for the first few designs you do, just to get the feel for how much is one “step” Several of the steps should be subdivided, like step 4 would include the store you would buy the materials from, a list of the materials needed, possibly prices Step 7 could be written as a repetition Repeat 4 times cut wood for a wall The order of several steps can be rearranged, like step 10 could be after step 11 Several steps could have more detail – the size of the dog would determine the size of the house, the location would depend on the size of the yard, the climate, the direction the house faces, Some people would make notes about insulation or a fan or A/C Assumptions about budget would be noted at the top

Building a dog house (with some refinements) 1.Decide on location for house 2.Decide on size of house 3.Get plans for house 4.Get materials for house 1.Get lumber 2.Get insulation 3.Get paint 4.Get nails 5.Cut wood for bottom of house 6.Put bottom platform together 7.Repeat 4 times 1.Cut wood for a wall of house 8.Assemble walls 9.Attach walls to bottom 10.Cut door in front side of house 11.Make roof 12.Attach roof to walls 13.Paint outside

How to do a design in this class Use an editor that creates a text file. The editors from IDLE or WingIDE work fine. Notepad is also ok. State the purpose of the design at the top Put your name, section and at the top Number the steps (hint: wait until you have the design finished before you number the steps, aggravating to have to renumber) Enter the steps in the editor as Python comments, using # or ‘’’ Write the steps in English, NOT Python!

Program design (in a file called design1.py) #Purpose: ask for a user’s name and say hello to them # Author: John Smith, section 1, #The main function #1. input the user’s name from the keyboard #2. output the name with the word hello before the name Save this as something like design1.py You ask why do I save it as a Python file? This file will be the basis of the actual implementation (Python) file Just load it into your editor and write Python code to do each step of the design – voila! You have your documentation done!

Implementation with design between code lines (in a file called greeting.py) #Purpose: ask for a user’s name and say hello to them # Author: John Smith, section 1, #The main function def main (): #1. input the user’s name from the keyboard name = input(“Your name? “) #2. output the name with the word hello before the name print(“Hello”, name) main()