Our Toolkit Graphics – lines, shapes, images, text, color, … Data of Various Types – Numbers (with and without decimal places) – Booleans (true, false)

Slides:



Advertisements
Similar presentations
Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Advertisements

A8 – Control Structures if, if-else, switch Control of flow in Java Any sort of complex program must have some ability to control flow.
How SAS implements structured programming constructs
Programming Paradigms and languages
Alice Methods and Classes. Methods and Classes Methods – Coordinated sequence of instructions carried out when requested (e.g. move, turn to, etc.) Class.
COMPUTER PROGRAMMING I Understand Problem Solving Tools to Design Programming Solutions.
Basics of Computer Programming Web Design Section 8-1.
While: Indefinite Loops Sec 8-14 Web Design. Objectives The student will: Understand what an Indefinite Loop is Understand how create an indefinite loop.
1 Divide & Conquer Algorithms. 2 Recursion Review A function that calls itself either directly or indirectly through another function Recursive solutions.
Divide-and-Conquer Recursive in structure –Divide the problem into several smaller sub-problems that are similar to the original but smaller in size –Conquer.
CS001 Introduction to Programming Day 3 Sujana Jyothi
Program Design and Development
16/23/2015 9:48 AM6/23/2015 9:48 AM6/23/2015 9:48 AMRecursion Recursion Recursion is when a function calls itself to implement an algorithm. Really a paradigm.
Information Technology Center Hany Abdelwahab Computer Specialist.
16/27/ :53 PM6/27/ :53 PM6/27/ :53 PMLogic Control Structures Arithmetic Expressions Used to do arithmetic. Operations consist of +,
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 3 – Combinational Logic Design Part 1 –
Week 11 Recap CSE 115 Spring Want to write a programming language? You’ll need three things: You’ll need three things: –Sequencing –Selection Polymorphism.
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 2: Algorithm Discovery and Design
Unusual Control Structures and General Control Issues A Presentation by CJ Castellani as told in an American accent.
Sort an array - the selection sort algorithm. Selection Sort Selection sort a classic computer algorithm that is used to sort an array The selection sort.
Fundamentals of Python: From First Programs Through Data Structures
Girl Develop It Ottawa Introduction to Programming With Scratch Introduction.
CS 101 – Oct. 5 Computer problem solving Chapter 6: read pp Problem-solving procedure Structure of a solution Examples!
Homework Problems 1. M1 runs the program P in 1.4 * 9 * ns or ns M2 runs the program P in 1.6*9800*10ns or ns Hence M2 is faster by.
Introduction Ellen Walker CPSC 201 Data Structures Hiram College.
Chapter 6 Functions 1. Opening Problem 2 Find the sum of integers from 1 to 10, from 20 to 37, and from 35 to 49, respectively.
Computers and Scientific Thinking David Reed, Creighton University JavaScript and User Interaction 1.
The Beauty and Joy of Computing Lecture #3 : Creativity & Abstraction UC Berkeley EECS Lecturer Gerald Friedland.
CompSci Today’s topics Java Review Just a bunch of headings meant to trigger questions A contraction of previous notes Upcoming Midterm Exam Reading.
By Melissa Dalis Professor Susan Rodger Duke University June 2011 Multiplication Table.
Section 4 - Functions. All of the programs that we have studied so far have consisted of a single function, main(). However, having more than one function.
Ch 2.5 Variable on Both Sides Objective: To solve equations where one variable exists on both sides of the equation.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 5A Repetition (Concepts)
Tower of Hanoi Puzzle Jianying Yu. I. Introduction The Puzzle: Conditions: n disks and three pegs. Conditions: n disks and three pegs. Goal: Move disks.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
Java Fundamentals Usman Ependi UBD
Introduction to C Programming CE Lecture 5 Program Design in C.
Higher Computing Software Development -So Far- 5/10/10.
Review Array – int[] diameters = new int[10]; – diameters[0], diameters[2], diameters[9] – diameters.length Indexing starts at 0 A way to have a collection.
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
INVITATION TO Computer Science 1 11 Chapter 2 The Algorithmic Foundations of Computer Science.
Large Digital Systems. Outline  Large Digital Systems  Top-Down Approach  Controller and Data Processor  Flowcharts.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Mid-Year Review. Coding Problems In general, solve the coding problems by doing it piece by piece. Makes it easier to think about Break parts of code.
Review Objects – data fields – constructors – Methods Classes.
chap10 Chapter 10 Recursion chap10 2 Recursive Function recursive function The recursive function is a kind of function that calls.
CPS Today’s topics Programming Recursion Invariants Reading Great Ideas, p Brookshear, Section Upcoming Copyrights, patents, and.
PYTHON IF-STATEMENTS. What you know If something is true, then something happens Example If you heat water to 100 degrees Celsius, then it boils If it.
1 CS 177 Week 13 Recitation Writing Complex Programs.
Sequence, Selection, Iteration The IF Statement
Welcome to Computer Science Jeopardy
Lecture 5 Dynamic Programming
Chapter 6 Functions.
Lesson 10: Building an App: Color Sleuth
Yenka Portfolio Level for this topic: Student Name : My Levels
Lecture 5 Dynamic Programming
Problem Solving Techniques
Simplify Expressions 34 A number divided by 3 is 7. n ÷ 3 = 7.
Chapter 10 Algorithms.
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Algorithm Discovery and Design
Flowcharting & Algorithms
ICT Programming Lesson 3:
Programming Fundamentals (750113) Ch1. Problem Solving
Using Decision Structures
Programming Fundamentals (750113) Ch1. Problem Solving
Chapter 10 Algorithms.
Presentation transcript:

Our Toolkit Graphics – lines, shapes, images, text, color, … Data of Various Types – Numbers (with and without decimal places) – Booleans (true, false) – Color (two color models) – Characters and Strings Variables – Hold/name any type of data values Operators – Mathematical(+, *, ++, %, …) – Relational( =, !=, ==, …) – Logical(&&, ||, !)

Our Toolkit (Continued) Functions – Mathematical, Graphical, Utility, … – Of our own design Expressions – Combination of data, variables, operators, functions Conditionals – if-statements Iterations – while-loop – for-loop Data Structures – Arrays – Functions that manipulate arrays Objects

Top-Down Design At first blush, solving a hard problem can seem daunting – Create a clone of Adobe Photoshop – Create a new web browser A common technique for solving complex problems is called Top-Down Design – a.k.a. "Step-wise Refinement" 1.Define a sequence of steps to solve a given problem at the highest, most abstract level. 2.Recursively, list a sequence of sub-steps to solve each higher-level step 3.Repeat until the sub-problem is "easy enough" to solve directly

Top-Down Design - Advantages Promotes Organization – Your code is naturally organized, and easy to understand – Avoids the "spaghetti code" syndrome Simplifies the Problem – The larger complex problem reduces to several smaller, more simple problems Promotes Reuse – Several sub-problem solutions may be reusable by multiple parts of your program – Some sub-problems have existing solutions implemented Enables Shared Development – Multiple people can work on different parts of the problem at the same time

Top-Down Design - Example Have Dinner 1.Cook Food 2.Set Table 3.Serve Food 4.Eat Food 5.Clean Up

Top-Down Design - Example Have Dinner 1.Cook Food 1.Boil Noodles 2.Stir-fry Veggies 3.Mix together 2.Set Table 3.Serve Food 4.Eat Food 5.Clean Up

Top-Down Design - Example Have Dinner 1.Cook Food 1.Boil Noodles 1.Boil water 2.Pour in dry noodles 3.Let cook 4.Strain noodles 2.Stir-fry Veggies 3.Mix 2.Set Table 3.Serve Food 4.Eat Food 5.Clean Up

Pop A game that measures your balloon-popping skill. How it should work… – As game runs, randomly placed balloons inflate – When the player pops (clicks on) a balloon, 1 point is earned – Points are added up throughout the game duration – If one click is over top multiple balloons, all balloons pop and multiple points are earned – The game runs for 30 seconds, and then ends