Unit 3: Lesson 9-Looping and Random Numbers

Slides:



Advertisements
Similar presentations
CS 101 Introductory Programming - Lecture 7: Loops In C & Good Coding Practices Presenter: Ankur Chattopadhyay.
Advertisements

Control Structure There are two kind of control structure in GWBASIC one is iteration/loop or repetitive and second make decision/condition. Iteration/Loop.
Lecture 12 Another loop for repetition The while loop construct © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
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.
Loops Repetition Statements. Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand basic loop concepts: ■ pretest loops and post-test loops ■ loop.
Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
MIT Lifelong Kindergarten’s Scratch Serious Computer Science, Playful Environment 4/25/2009 Puget Sound CSTA meeting.
For Loops 2 ENGR 1181 MATLAB 9. For Loops and Looped Programming in Real Life As first introduced last lecture, looping within programs has long been.
For Loops. Challenge: Racer ● Simulate a race that says “Now on lap X” for 10 laps. ● Make X vary, so it says 1, then 2, then 3 ● Use only one output.
Graphics and Procedures Programming Right from the Start with Visual Basic.NET 1/e 5.
Chapter 5 Control Structures: Loops 5.1 The while Loop The while loop is probably the most frequently used loop construct. The while loop is a conditional.
Computer Programming 12 Mr. Jean May 8 th, The plan: Video clip of the day Upcoming Assessment Bot.java.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #5: Programming Structures IE 212: Computational Methods for Industrial Engineering.
1 Objectives ❏ To understand basic loop concepts: ■ pretest loops and post-test loops ■ loop initialization and updating ■ event and counter controlled.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 5A Repetition (Concepts)
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Chapter 6 Questions Quick Quiz
1 For Loops l From Chapter 9 l A shorthand way of coding count loops.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
 2003 Prentice Hall, Inc. All rights reserved. 1 Outline 11.1 Test-Driving the Interest Calculator Application 11.2 Essentials of Counter-Controlled Repetition.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Progression in KS3/4 Algorithms MONDAY 30 TH NOVEMBER SUE SENTANCE.
Computer Programming 12 Lesson 6 – Loop structure By: Dan Lunney.
Phase 3: Game Creation. Phase 3: Game Creation Outcomes (Slide 1) I can create a flowchart to solve a problem, for example to make a cup of tea. I can.
Day 5- Sending Numbers Code.org- Unit 1, Lesson 6.
Program design Program Design Process has 2 phases:
Computer Programming.
Finding Trends and Check Assumptions
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
Unit 3 Lesson 4 & 5- Programming With Simple Commands / Creating Functions Day 26.
Creating Functions with Parameters
Unit 3 lesson 2&3 The Need For Algorithms- Creativity in Algorithms
UNIT 3 – LESSON 5 Creating Functions.
Think What will be the output?
Looping and Random Numbers
Chapter 5: Repetition Structures
ITM 352 Flow-Control: Loops
Beginning C Lecture 4 Lecturer: Dr. Zhao Qinpei
Introducing Do While & Do Until Loops & Repetition Statements
Iterations Programming Condition Controlled Loops (WHILE Loop)
LESSON 11 – WHILE LOOPS UNIT 5 – 1/10/17.
Chapter 6 Repetition Objectives ❏ To understand basic loop concepts:
Intro to Computer Science CS1510 Dr. Sarah Diesburg
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Procedures.
Day 5- Sending Numbers Code.org- Unit 1, Lesson 6.
Lesson 15: Processing Arrays
Chapter 6: Repetition Structures
Chapter 5: Repetition Structures
Designing Experiments
Creating Functions with Parameters
Looping and Random Numbers
Chapter 4 Loops While loop The for loop do… while break and continue
Unit 3: Lesson 6 & 7- Functions and Top-Down Design / APIs and Function Parameters Day 27.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Mod 2 Lesson 2 Repeating Debugging
Mod 2 Lesson 2 Repeating with loops
Finding Trends and Check Assumptions
Unit 3 lesson 2-5 The Need For Algorithms- Creativity in Algorithms – Simple Commands - Functions Day 18.
Day 5- Sending Numbers Code.org- Unit 1, Lesson 6.
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer Low level programming language: A programming.
Repetition Statements (Loops) - 2
PROGRAM FLOWCHART Iteration Statements.
The structure of programming
Thinking procedurally
CMPT 120 Lecture 16 – Unit 3 – Graphics and Animation
JavaScript 101 Lesson 8: Loops.
Presentation transcript:

Unit 3: Lesson 9-Looping and Random Numbers Day 29

Review/Journal/Quiz Quiz Journal Check

Looping and Random Numbers Even after creating functions with parameters, there are still instances when our code can be repetitive because we wish to call the same function or group of functions many times.

Looping and Random Numbers Tutorial Video: Loops Using loops to draw figures. Use loops in conjunction with Top-Down Design and random values to complete a digital scene.

Looping and Random Numbers The ability to repeat a series of steps, often referred to as iteration, allows us to more easily solves these problems. In most programming languages a programming construct called a loop allows you to repeatedly call (or "loop over") a set of commands. This lesson explores the power of loops by introducing the for loop.

Looping and Random Numbers Loop: a programming construct that repeats a group of commands. Iteration: "loop" by another name - the repetition of a statement, process, or procedure. For Loop - A particular kind of looping construct provided in many languages. Typically, a for loop defines a counting variable that is checked and incremented on each iteration in order to loop a specific number of times.

Looping and Random Numbers Tutorial Video: Loops Using loops to draw figures. Use loops in conjunction with Top-Down Design and random values to complete a digital scene. Complete Lesson 9 code.org

Lesson 10 Start Lesson 10- Group Project Review / Next Class