Intro to Programming CURIE 2011.

Slides:



Advertisements
Similar presentations
CATHERINE AND ANNIE Python: Part 3. Intro to Loops Do you remember in Alice when you could use a loop to make a character perform an action multiple times?
Advertisements

If Statements, Try Catch and Validation. The main statement used in C# for making decisions depending on different conditions is called the If statement.
1 Pertemuan 14 PHP: Conditions-loops-functions-Array Last Updated: 23 rd May 2011 By M. Arief
Conditional Statements and Loops. Today’s Learning Goals … Learn about conditional statements and their structure Learn about loops and their structure.
IDL Tutorials: Day 4 Goal: Learn some programming techniques: Relational operators, conditional statements, boolean operators, loops Angela Des Jardins.
IS437: Fall 2004 Instructor: Dr. Boris Jukic Program Flow Control: Decisions and Conditions (Branching) Controlled Repetition (Looping)
Lecture 4 More Examples of Karnaugh Map. Logic Reduction Using Karnaugh Map Create an Equivalent Karnaugh Map Each circle must be around a power of two.
CSE 115 Week 11 March , Announcements March 26 – Exam 7 March 26 – Exam 7 March 28 – Resign Deadline March 28 – Resign Deadline Lab 7 turned.
Slide 1 VB Program Flow Control. Slide 2 Making Decisions v Decision Statement: control the execution of parts of the program based on conditions. v The.
IAT 800 Lab 1: Loops, Animation, and Simple User Interaction.
Week 10 Recap CSE 115 Spring For-each loop When we have a collection and want to do something to all elements of that collection we use the for-each.
Basic Elements of Programming A VB program is built from statements, statements from expressions, expressions from operators and operands, and operands.
1 Lecture 7:Control Structures I (Selection) Introduction to Computer Science Spring 2006.
General Computer Science for Engineers CISC 106 Lecture 05 Dr. John Cavazos Computer and Information Sciences 2/20/2009.
Programming with MATLAB. Relational Operators The arithmetic operators has precedence over relational operators.
CS 106 Introduction to Computer Science I 09 / 28 / 2007 Instructor: Michael Eckmann.
Intro to Robots Conditionals and Recursion. Intro to Robots Modulus Two integer division operators - / and %. When dividing an integer by an integer we.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Python – Part 4 Conditionals and Recursion. Modulus Operator Yields the remainder when first operand is divided by the second. >>>remainder=7%3 >>>print.
Mr C Johnston ICT Teacher BTEC IT Unit 06 - Lesson 05 Learning To Program.
Python – Making Decisions Lecture 02. Control Structures A program that only has one flow is useful but limited. We can use if statements to make these.
COMPUTER PROGRAMMING. Control Structures A program is usually not limited to a linear sequence of instructions. During its process it may repeat code.
MIPS function continued. Recursive functions So far, we have seen how to write – A simple function – A simple function that have to use the stack to save.
PHP Conditional Statements Conditional statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very.
Microcontroller I Seth Price Department of Chemical Engineering New Mexico Tech Rev. 9/22/14.
ㅎㅎ logical operator if if else switch while do while for Third step for Learning C++ Programming Repetition Control Structures.
Saeed Ghanbartehrani Summer 2015 Lecture Notes #5: Programming Structures IE 212: Computational Methods for Industrial Engineering.
Object Oriented Programming Lecture 4: Flow Control Mustafa Emre İlal
Module 3: Steering&Arrays #1 2000/01Scientific Computing in OOCourse code 3C59 Module 3: Algorithm steering elements If, elseif, else Switch and enumerated.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 ‏ Control Structures.
Conditional Expression One of the most useful tools for processing information in an event procedure is a conditional expression. A conditional expression.
IDL Tutorials: Day 4 Goal: Learn some programming techniques: Relational operators, conditional statements, boolean operators, loops Maria Kazachenko
Chapter 6.  Control Structures are statements that are used to perform repetitive tasks and to make decisions within a program. Loop repeats a sequence.
Overview of VBA Programming & Syntax. Programming With Objects u Objects –Properties: attributes or characteristics of an object (e.g., font size, color,
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Selection Statements. Introduction Today we learn more about learn to make decisions in Turing ▫Nested if statements, ▫case statements.
ITEC 109 Lecture 11 While loops. while loops Review Choices –1 st –2 nd to ?th –Last What happens if you only use ifs? Can you have just an else by itself?
Digital Electronics Board-of-Education : Output. Board of Education - Output This presentation will explain, both from a hardware and software perspective,
31/01/ Selection If selection construct.
Expressions and Control Flow. Expressions An expression is a combination of values, variables, operators, and functions that results in a value y = 3(abs(2x)
CS-1010 Dr. Mark L. Hornick 1 Selection and Iteration and conditional expressions.
Lab 6 (1) Range Review, Control Logic and Loops ► Control Logic and Loops ► Exercise.
Program Structures Chapter 5. 5 Branching Allows different code to execute based on a conditional test. if, if-else, and switch statements.
Expressions and Order of Operations Operators – There are the standard operators: add, subtract, divide, multiply – Note that * means multiply? (No times.
Loop and repetition. Today Passing values to and back from Sub procedures Option Buttons Do While Loops For Loops Population Growth.
Copyright 2006 Addison-Wesley Brief Version of Starting Out with C++ Chapter 5 Looping.
National Diploma Unit 4 Introduction to Software Development Data Structures – Loops and selection.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Sensor Information: while loops and Boolean Logic.
Discussion 4 eecs 183 Hannah Westra.
CHAPTER 4 DECISIONS & LOOPS
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Visual Basic 6 (VB6) Data Types, And Operators
Operators Operators are symbols such as + (addition), - (subtraction), and * (multiplication). Operators do something with values. $foo = 25; $foo – 15;
Programming Fundamentals
Simple Control Structures
For Loops October 12, 2017.
JavaScript conditional
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Logical Operations In Matlab.
Computer Science Core Concepts
Conditional Logic Presentation Name Course Name
By Andrew Horn And Ryan Kluck
There many situations comes in real life when we need to make some decisions and based on these decisions, we decide what should we do next. Similar situations.
ASP control structure BRANCHING STATEMENTS
Designing Software.
How to allow the program to know when to stop a loop.
Lesson 3. Controlling program flow. Loops. Methods. Arrays.
COMPUTING.
G6DICP - Lecture 5 Control Structures.
Presentation transcript:

Intro to Programming CURIE 2011

Variables Variables hold values Variables must be declared before putting values in them The size of the variable must be large enough to hold the value: A bit-sized variable can hold a bit: 0-1 A byte-sized variable can hold a byte: 0-255 A word-sized variable van hold a word: 0-65535

Making Things Happen Over and Over… FOR…NEXT – certain number of times DO …. WHILE – while a certain condition is met DO … UNTIL – until a certain condition is met DO … LOOP – unconditionally repeat

Making Decisions IF … THEN – if a certain condition is met then do something ELSEIF – if another condition is met ELSE – in all other cases SELECT …. CASE – certain situations Logic: X > Y – greater than X < Y – less than X >= Y – greater than or equal to X <= Y – less than or equal to X <> Y – not equal to X AND Y – both conditions must be met X OR Y – either condition must be met

Subroutines Do specific things Must be given a label or name Can be “called” by main program Control returns to main program, line after being called Allows same code to be used over and over Makes program more compact, shorter, more logical