Coding Design Tools Rachel Gauci. What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally.

Slides:



Advertisements
Similar presentations
Decisions If statements in C.
Advertisements

CS107 Introduction to Computer Science Lecture 2.
Introduction to working with Loops  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course. Introduction to Computers and Programming.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 5, 2005.
Introduction to Computers and Programming Lecture 8: More Loops New York University.
Switch structure Switch structure selects one from several alternatives depending on the value of the controlling expression. The controlling expression.
Designing Algorithms Csci 107 Lecture 3. Designing algorithms Last time –Pseudocode –Algorithm: computing the sum 1+2+…+n –Gauss formula for 1+2+…+n Today.
Pseudocode and Algorithms
Introduction to Computers and Programming More Loops  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course.
COMP 14 Introduction to Programming Miguel A. Otaduy May 20, 2004.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
COMP 110 Introduction to Programming Mr. Joshua Stough September 24, 2007.
ALGORITHMS AND FLOWCHARTS
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
HOMEWORK REVIEW This is an if else statement layout if (condition) { code to be executed if condition is true; } else { code to be executed if condition.
Structured Program Development Outline 2.1Introduction 2.2Algorithms 2.3Pseudo code 2.4Control Structures 2.5The If Selection Structure 2.6The If/Else.
CSE 102 Introduction to Computer Engineering What is an Algorithm?
Repetition & Loops. One of the BIG advantages of a computer: ­It can perform tasks over and over again, without getting bored or making mistakes (assuming.
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
Review for Exam2 Key Ideas 1. Key Ideas: Boolean Operators (2 > 3) || (3 < 29.3) A.True B.False C.Impossible to determine (22 > 3) && (3 > 29.3) A.True.
1 Loops. 2 Topics The while Loop Program Versatility Sentinel Values and Priming Reads Checking User Input Using a while Loop Counter-Controlled (Definite)
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
Control Structures II Repetition (Loops). Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1.
Coding Design Tools Rachel Gauci. Task: Counting On Create a program that will print out a sequence of numbers from "1" to a "number entered”. Decision’s.
Lecture 4: Calculating by Iterating. The while Repetition Statement Repetition structure Programmer specifies an action to be repeated while some condition.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Control Statements I.
Lecture 4: C/C++ Control Structures Computer Programming Control Structures Lecture No. 4.
Structured Program Development Angela Chih-Wei Tang ( 唐 之 瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan 2010.
1. Understand the application of Pseudo Code for programming purposes 2. Be able to write algorithms in Pseudo Code.
Lecture 5: Stopping with a Sentinel. Using a Sentinel Problem Develop a class-averaging program that will process an arbitrary number of grades each time.
Introduction to Loops For Loops. Motivation for Using Loops So far, everything we’ve done in MATLAB, you could probably do by hand: Mathematical operations.
Chapter 7 Problem Solving with Loops
Think Possibility 1 Iterative Constructs ITERATION / LOOPS C provides three loop structures: the for-loop, the while-loop, and the do-while-loop. Each.
The ‘while’ loop ‘round and ‘round we go.
Introduction to Computers and Programming Lecture 7:
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
Intro to Loops 1.General Knowledge 2.Two Types of Loops 3.The WHILE loop 1.
Algorithms and Computer Programming. Algorithms algorithm is an ordered sequence of instructions for solving a problem. Look at it as a building blocks.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
Algorithms and Pseudocode
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
CC213 Programming Applications Week #2 2 Control Structures Control structures –control the flow of execution in a program or function. Three basic control.
Computer Programming 12 Lesson 6 – Loop structure By: Dan Lunney.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
Selection Using IF THEN ELSE CASE Introducing Loops.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 3 - Structured Program Development Outline.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Flow Control (while) Outline 3.7The While Repetition.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 23, 2005 Lecture Number: 11.
Program design Program Design Process has 2 phases:
while Repetition Structure
Chapter 5: Control Structure
Week 4 – Repetition Structures / Loops
Introduction To Flowcharting
ALGORITHMS AND FLOWCHARTS
Control Structure Senior Lecturer
Algorithms & Pseudocode
Structured Program
Programming in Pseudocode
ALGORITHMS AND FLOWCHARTS
3 Control Statements:.
Computing Fundamentals
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Flowcharts and Pseudo Code
EPSII 59:006 Spring 2004.
WJEC GCSE Computer Science
Module 4 Loops and Repetition 9/19/2019 CSE 1321 Module 4.
Presentation transcript:

Coding Design Tools Rachel Gauci

What are Coding Design Tools? IPO charts (Input Process Output) Input- Make a list of what data is required (this generally involves the variables created, that can be manipulated) Processing- Make a list of any calculations that might have to be performed Output- Make a list of everything you are required to output Pseudocode Pseudocode is an informal language that helps programmers develop algorithms. Pseudocode is a "text-based" detail design tool. The rules of Pseudocode are reasonably straightforward. All statements showing "dependency" are to be indented. These include while, do, for, if, else. INPUTPROCESSOUTPUT Fill this in 2ndFill this in lastFill this in 1st IF student's grade is greater than or equal to 60 Print "passed” ELSE Print "failed”

Example- Pseudocode Pseudocode’s used to point out the actions in your script. How is this done? You write your script in an informal way, leaving out ; () {} etc. then you put the main words in capitals/ bold making them stand out. Ideally we want to write what we want a particular part of code to look like E.G. #pragma strict var age= 22; function Start() { if (age >= 18) { Debug.Log ("You Qualify"); } else { Debug.Log("You do not qualify"); } } function Update() { } IF AGE >= 18 THEN PRINT “You Qualify” ELSE PRINT “You do not qualify” END IF

More Pseudocode puting/cs/programming/good- practices/p/pseudo-code this is for drawings and in its simplest form explains pseudo code and why we use it. However this demonstration is not how I want it set out. ntro/pseudocode2js-v02.pdf Set total to zero Set grade counter to one WHILE grade counter is less than or equal to ten Input the next grade ADD the grade into the total Set the class average to the total divided by ten PRINT class average. START Program Enter two numbers A, B Add the numbers together PRINT sum END program

Example- IPO charts #pragma strict var age= 22; function Start() { if (age >= 18) { Debug.Log ("You Qualify"); } else { Debug.Log("You do not qualify"); } } function Update() { } INPUTPROCESSOUTPUT AgeUser puts in age -- it is determined whether the person is 18 or > < Results whether “You Qualify” or “You do not Qualify”

LOOPS FOR LOOPS- the loop is repeated a "specific" number of times, determined by the program or the user. The loop "counts" the number of times the body will be executed. This loop is a good choice when the number of repetitions is known, or can be supplied by the user. While Loops: The loop must repeat until a certain "condition" is met. If the "condition" is FALSE at the beginning of the loop, the loop is never executed. The "condition" may be determined by the user at the keyboard. The "condition" may be a numeric or an alphanumeric entry. This is a good, solid looping process with applications to numerous situations.

The for loop is used to repeat a section of code known number of times. Sometimes it is the computer that knows how many times, not you, but it is still known. Some examples: Unknown number of times: "Ask the User to Guess a pre-determined number between 1 and 100". You have no way of knowing how many guesses it will take. "Randomly look in an array for a given value." You have no way of knowing how many tries it will take to find the actual value. Note: this is a made-up example, because you would never randomly look into an array to find a value. You would always start at the front of the array and look one element at a time until you found the item or got to the end of the array. Known number of times: Compute the average grade of the class. While you (the programmer) might not know how many grades exist in the class, the computer will know. Usually this is accomplished by using the "length" function on an array. Print the odd numbers from 1 to Search a list (array) of numbers for the biggest grade. Again, the computer "knows" how many grades there are, so a for loop is appropriate.