Algorithms and Conditionals
|
|
- Eric Scott
- 6 years ago
- Views:
Transcription
1 August 26, 2013
2 Charactaristics of an Algorithm Charactaristics of an Algorithm Calculating Monitor Size if
3 Charactaristics of an Algorithm Calculating Monitor Size 5 charactaristics of a good algorithm: 1. Defined inputs 2. Defined outputs 3. Complete (no implied steps) 4. All steps are doable by a computer 5. Finite (finishes eventually) Number 5 above is an issues once we start using loops
4 Calculating Monitor Size Charactaristics of an Algorithm Calculating Monitor Size Input: Diagonal size (diagonal), ratio (a, b) diagonal 1. Store the result of 2 in X 1 a 2 +b 2 2. Calculate a X, store in side1 3. Calculate b X, store in side2 4. Calculate side1 side2, store in Size Output: Size, side1, side2 1 X is something I made up years ago. I ve since forgotten what it was supposed to represent, but it does make the calculation work.
5 if The if statement Do something based on a condition Many real-world equivalents (if you clean your room, then you can have cake for dinner) The condition must be something a computer can figure out! Example 1: if x > y... Example 2: if y 4 < x and y > z... General form for an algorithm if statement (not correct MATLAB): if condition then Thing(s) to do if condition is true end if
6 if Example: Guess the number! Input: Two guesses, guess1 and guess2, plus the secret number (secret) 1. if guess1 secret < guess2 secret then 2. store First guess was closer! in message 3. end if 4. if guess1 secret > guess2 secret then 5. store Second guess was closer! in message 6. end if 7. if guess1 secret == guess2 secret then 8. store Tie! in message 9. end if Output: Message indicating which guess was closer
7 if Similar to the English otherwise If you clean your room, you can have cake for dinner. Else, you can have a single uncooked potato for dinner. Allows you to avoid repeating conditions over and over. General form: if condition then Thing(s) to do if condition is true ( then is generally not used here) Thing(s) to do if condition is false end if Indentation is starting to matter - see next example
8 if Guess the number, improvement 1 Input: Two guesses, guess1 and guess2, plus the secret number (secret) 1. if guess1 secret < guess2 secret then 2. store First guess was closer! in message if guess1 secret > guess2 secret then 5. store Second guess was closer! in message store Tie! in message 8. end if (For the first if ) 9. end if (For the second if ) Output: Message indicating which guess was closer
9 if if ( if ) If you clean your room, you can have cake for dinner. Elsif you clean the litter box, you can have soup for dinner. Else, you can have a single uncooked potato for dinner. This is a more elegant way to write the last example if is the word MATLAB uses. Some other languages use elif, or simply if General form: if condition then Thing(s) to do if condition is true if second condition then Thing(s) to do if condition is false, and second condition is true ( then is generally not used here) Thing(s) to do if condition is false end if
10 if Guess the number, improvement 2 Input: Two guesses, guess1 and guess2, plus the secret number (secret) 1. if guess1 secret < guess2 secret then 2. store First guess was closer! in message 3. if guess1 secret > guess2 secret then 4. store Second guess was closer! in message store Tie! in message 7. end if Output: Message indicating which guess was closer
11 if quiz Write an algorithm to determine the maximum of three numbers Input: A, B, and C Output: Maximum of the three You don t need to figure out which one was biggest, just what the maximum of the three is. Watch out for ties! The maximum of 3, 5, and 5 is 5. If it helps, you can use or. Not due. Just see if you can do it for your own sake.
12 What an algorithm is How if statements work in an algorithm (including and if) (After doing the quiz) the ability to write simple algorithms.
Quiz 1: Functions and Procedures
Quiz 1: Functions and Procedures Outline Basics Control Flow While Loops Expressions and Statements Functions Primitive Data Types 3 simple data types: number, string, boolean Numbers store numerical data
More informationComp 151. Control structures.
Comp 151 Control structures. admin quiz this week believe it or not only 2 weeks from exam. one a week each week after that. idle debugger Debugger: program that will let you look at the program as it
More informationComp 151. Control structures.
Comp 151 Control structures. admin For these slides read chapter 7 Yes out of order. Simple Decisions So far, we ve viewed programs as sequences of instructions that are followed one after the other. While
More informationFlow Control: Branches and loops
Flow Control: Branches and loops In this context flow control refers to controlling the flow of the execution of your program that is, which instructions will get carried out and in what order. In the
More informationChapter 4: Programming with MATLAB
Chapter 4: Programming with MATLAB Topics Covered: Programming Overview Relational Operators and Logical Variables Logical Operators and Functions Conditional Statements For Loops While Loops Debugging
More informationMATLAB provides several built-in statements that allow for conditional behavior if/elseif/else switch menu
Chapter 3 What we have done so far: Scripts/Functions have executed all commands in order, not matter what What we often need: A piece of code that executes a series of commands, if and only if some condition
More informationDecision Structures CSC1310. Python Programming, 2/e 1
Decision Structures CSC1310 Python Programming, 2/e 1 Simple Decisions Decision structures, which are statements that allow a program to execute different sequences of instructions for different cases,
More informationText Input and Conditionals
Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()
More informationnpm run pull npm start
1. Open Visual Studio Code 2. At the top click on View->Integrated Terminal (if not already open) 3. In the terminal, first run: npm run pull 4. After this finishes run: npm start Loops Lecture 09 Don
More informationLecture. Algorithm Design and Recursion. Richard E Sarkis CSC 161: The Art of Programming
Lecture Algorithm Design and Recursion Richard E Sarkis CSC 161: The Art of Programming Class Administrivia Objectives To understand the basic techniques for analyzing the efficiency of algorithms To know
More informationCMSC201 Computer Science I for Majors
CMSC201 Computer Science I for Majors Lecture 06 Decision Structures Prof. Katherine Gibson Prof. Jeremy Dixon Based on concepts from: https://blog.udemy.com/python-if-else/ Last Class We Covered Just
More informationQuiz. Introduction: Python. In this project, you ll make a quiz game to challenge your friends. Activity Checklist.
Python 1 Quiz All Code Clubs must be registered. Registered clubs appear on the map at codeclub.org.uk - if your club is not on the map then visit jumpto.cc/18cplpy to find out what to do. Introduction:
More informationTHE IF STATEMENT. The if statement is used to check a condition: if the condition is true, we run a block
THE IF STATEMENT The if statement is used to check a condition: if the condition is true, we run a block of statements (called the if-block), elsewe process another block of statements (called the else-block).
More informationSubversion was not there a minute ago. Then I went through a couple of menus and eventually it showed up. Why is it there sometimes and sometimes not?
Subversion was not there a minute ago. Then I went through a couple of menus and eventually it showed up. Why is it there sometimes and sometimes not? Trying to commit a first file. There is nothing on
More informationCardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15
Cardinality of Sets MAT Transition to Higher Mathematics Fall 0 MAT (Transition to Higher Math) Cardinality of Sets Fall 0 / Outline Sets with Equal Cardinality Countable and Uncountable Sets MAT (Transition
More informationCMSC201 Computer Science I for Majors
CMSC201 Computer Science I for Majors Lecture 05 Algorithmic Thinking Last Class We Covered Decision structures One-way (using if) Two-way (using if and else) Multi-way (using if, elif, and else) Nested
More informationBEGINNER PHP Table of Contents
Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing
More informationAccounts and Passwords
Accounts and Passwords Hello, I m Kate and we re here to learn how to set up an account on a website. Many websites allow you to create a personal account. Your account will have its own username and password.
More informationPython Programming: An Introduction to Computer Science
Python Programming: An Introduction to Computer Science Chapter 7 Decision Structures Python Programming, 2/e 1 Simple Decisions So far, we ve viewed programs as sequences of instructions that are followed
More informationRELATIONAL AND LOGICAL OPERATORS
Contents RELATIONAL AND LOGICAL OPERATORS... Relational Operators... Logical Operators... Using Relational and Logical Operators with Scalars... 2 Using Relational Operators with Numerical Arrays... 5
More informationCMPT 120 Control Structures in Python. Summer 2012 Instructor: Hassan Khosravi
CMPT 120 Control Structures in Python Summer 2012 Instructor: Hassan Khosravi The If statement The most common way to make decisions in Python is by using the if statement. The if statement allows you
More informationSpring 2017 CS 1110/1111 Exam 2
Spring 2017 CS 1110/1111 Exam 2 Bubble in your computing ID in the footer of this page. We use an optical scanner to read it, so fill in the bubbles darkly. If you have a shorter ID, leave some rows blank.
More informationCS 3 Midterm 1 Review
CS 3 Midterm 1 Review 1. Quick Evaluations Indicate what each of the following would return if typed into STK. If you think it would error, then please write ERROR. If you think that it would loop forever,
More informationCS 115 Lecture 8. Selection: the if statement. Neil Moore
CS 115 Lecture 8 Selection: the if statement Neil Moore Department of Computer Science University of Kentucky Lexington, Kentucky 40506 neil@cs.uky.edu 24 September 2015 Selection Sometime we want to execute
More informationHow Your First Program Works
How Your First Program Works Section 2: How Your First Program Works How Programs Are Structured...19 Method Main ( )...21 How Programs Are Structured In Section 1, you typed in and ran your first program
More informationPython - Conditional Execution
Python - Conditional Execution x = 5 X < 10? Yes Conditional Steps Program: print 'Smaller' x = 5 Output: if x < 10: X > 20? Yes print 'Smaller Smaller Finis print 'Bigger' if x > 20: print 'Bigger' print
More informationGrade 6 Math Circles October 16 & Non-Euclidean Geometry and the Globe
Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles October 16 & 17 2018 Non-Euclidean Geometry and the Globe (Euclidean) Geometry Review:
More informationIntroduction to Computer Science Unit 3. Programs
Introduction to Computer Science Unit 3. Programs This section must be updated to work with repl.it Programs 1 to 4 require you to use the mod, %, operator. 1. Let the user enter an integer. Your program
More informationTopic 2: Making Decisions
Topic 2: Making Decisions 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 3.1, 3.5, 3.8, 3.9, 3.10, 3.11, 3.13, 3.14, 3.16, 3.17, 3.18, 3.19,
More informationTopic 2: Making Decisions
Recommended Exercises and Readings Topic 2: From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 3.1, 3.5, 3.8, 3.9, 3.10, 3.11, 3.13, 3.14, 3.16, 3.17, 3.18, 3.19, 3.20, 3.22, 3.23
More informationDefinition MATH Benjamin V.C. Collins, James A. Swenson MATH 2730
MATH 2730 Benjamin V.C. Collins James A. Swenson s and undefined terms The importance of definition s matter! may be more important in Discrete Math than in any math course that you have had previously.
More informationLecture 2 Finite Automata
Lecture 2 Finite Automata August 31, 2007 This lecture is intended as a kind of road map to Chapter 1 of the text just the informal examples that I ll present to motivate the ideas. 1 Expressions without
More informationLecture 3 (02/06, 02/08): Condition Statements Decision, Operations & Information Technologies Robert H. Smith School of Business Spring, 2017
Lecture 3 (02/06, 02/08): Condition Statements Decision, Operations & Information Technologies Robert H. Smith School of Business Spring, 2017 K. Zhang BMGT 404 The modulus operator It works on integers
More informationAn Introduction to MATLAB
An Introduction to MATLAB Day 1 Simon Mitchell Simon.Mitchell@ucla.edu High level language Programing language and development environment Built-in development tools Numerical manipulation Plotting of
More informationCSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch
CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed
More informationObjective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions
Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions Variable is a letter or symbol that represents a number. Variable (algebraic)
More informationLecture Transcript While and Do While Statements in C++
Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some
More informationTHE AUSTRALIAN NATIONAL UNIVERSITY Mid Semester Examination September COMP1730 / COMP6730 Programming for Scientists
THE AUSTRALIAN NATIONAL UNIVERSITY Mid Semester Examination September 2016 COMP1730 / COMP6730 Programming for Scientists Study Period: 15 minutes Time Allowed: 2 hours Permitted Materials: One A4 page
More informationAsking for information (with three complex questions, so four main paragraphs)
Structures of different kinds of emails Write typical paragraph plans for the kinds of emails, describing the paragraphs in the body and what kinds of opening lines and closing lines you need. Asking for
More informationLOOPS. Repetition using the while statement
1 LOOPS Loops are an extremely useful feature in any programming language. They allow you to direct the computer to execute certain statements more than once. In Python, there are two kinds of loops: while
More informationINTRODUCTION. 2
1 INTRODUCTION It is of no secret that Android is loved by millions of people around the world. Created and developed by Google, it would be most developers dream job. That being said, there are a lot
More informationAP Computer Science Unit 3. Programs
AP Computer Science Unit 3. Programs For most of these programs I m asking that you to limit what you print to the screen. This will help me in quickly running some tests on your code once you submit them
More informationCMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012
CMPSCI 250: Introduction to Computation Lecture #7: Quantifiers and Languages 6 February 2012 Quantifiers and Languages Quantifier Definitions Translating Quantifiers Types and the Universe of Discourse
More informationChapter01.fm Page 1 Monday, August 23, :52 PM. Part I of Change. The Mechanics. of Change
Chapter01.fm Page 1 Monday, August 23, 2004 1:52 PM Part I The Mechanics of Change The Mechanics of Change Chapter01.fm Page 2 Monday, August 23, 2004 1:52 PM Chapter01.fm Page 3 Monday, August 23, 2004
More informationRepetition Algorithms
Repetition Algorithms Repetition Allows a program to execute a set of instructions over and over. The term loop is a synonym for a repetition statement. A Repetition Example Suppose that you have been
More informationCSE 143: Computer Programming II Summer 2017 HW5: Anagrams (due Thursday, August 3, :30pm)
CSE 143: Computer Programming II Summer 2017 HW5: Anagrams (due Thursday, August 3, 2017 11:30pm) This assignment focuses on recursive backtracking. Turn in the following files using the link on the course
More informationLecture 8. Conditionals & Control Flow
Lecture 8 Conditionals & Control Flow Announcements For This Lecture Readings Sections 5.1-5.7 today Chapter 4 for Tuesday Assignment 2 Posted Today Written assignment Do while revising A1 Assignment 1
More informationSolutions to First Exam, Math 170, Section 002 Spring 2012
Solutions to First Exam, Math 170, Section 002 Spring 2012 Multiple choice questions. Question 1. You have 11 pairs of socks, 4 black, 5 white, and 2 blue, but they are not paired up. Instead, they are
More informationHow Do Robots Find Their Way?
How Do Robots Find Their Way? Conditionals and Repetition http://en.wikipedia.org/wiki/file:cyclope_robot.jpg http://www.youtube.com/watch?v=_l9rklaskwu Learning Objectives Learn basic programming concepts
More informationPython Programming: An Introduction To Computer Science
Python Programming: An Introduction To Computer Science Chapter 8 Loop Structures and Booleans Python Programming, 3/e 1 Objectives To understand the concepts of definite and indefinite loops as they are
More informationEGR 111 Loops. This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times.
EGR 111 Loops This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times. New MATLAB commands: for, while,, length 1. The For Loop Suppose we want print a statement
More informationCSE 120. Computer Science Principles
Adam Blank Lecture 17 Winter 2017 CSE 120 Computer Science Principles CSE 120: Computer Science Principles Proofs & Computation e w h e q 0 q 1 q 2 q 3 h,e w,e w,h w,h q garbage w,h,e CSE = Abstraction
More informationCOSC 2P95. Procedural Abstraction. Week 3. Brock University. Brock University (Week 3) Procedural Abstraction 1 / 26
COSC 2P95 Procedural Abstraction Week 3 Brock University Brock University (Week 3) Procedural Abstraction 1 / 26 Procedural Abstraction We ve already discussed how to arrange complex sets of actions (e.g.
More informationMAS115: R programming Lecture 2: Pseudocode Lab Class and Technical Material: Matrices, Factors, Data frames, Lists
MAS115: R programming Lecture 2: Pseudocode Lab Class and Technical Material: Matrices, Factors, Data frames, Lists The University of Sheffield School of Mathematics and Statistics Problems Class Aims
More information61A Lecture 3. Friday, September 5
61A Lecture 3 Friday, September 5 Announcements There's plenty of room in live lecture if you want to come (but videos are still better) Please don't make noise outside of the previous lecture! Homework
More informationCSE200 Lecture 6: RECURSION
Table of Contents Review of functions (using factorial example)... 1 Recursion... 1 Step by step run through of recursive factorial... 2 Recursion vs. iteration (for and while loops)... 3 Helper functions:...
More informationAn Introduction to Python
An Introduction to Python Day 2 Renaud Dessalles dessalles@ucla.edu Python s Data Structures - Lists * Lists can store lots of information. * The data doesn t have to all be the same type! (unlike many
More informationCS 115 Lecture. Boolean logic Taken from notes by Dr. Neil Moore
CS 115 Lecture Boolean logic Taken from notes by Dr. Neil Moore Boolean logic and logical operators There are three logical operators that let us combine Boolean expressions. They have lower precedence
More informationOutline Key Management CS 239 Computer Security February 9, 2004
Outline Key Management CS 239 Computer Security February 9, 2004 Properties of keys Key management Key servers Certificates Page 1 Page 2 Introduction Properties of Keys It doesn t matter how strong your
More informationUsing Functions in Alice
Using Functions in Alice Step 1: Understanding Functions 1. Download the starting world that goes along with this tutorial. We will be using functions. A function in Alice is basically a question about
More informationConditionals and Recursion. Python Part 4
Conditionals and Recursion Python Part 4 Modulus Operator Yields the remainder when first operand is divided by the second. >>>remainder=7%3 >>>print (remainder) 1 Boolean expressions An expression that
More informationIntro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming
Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals
More informationWelcome! COMP s1. Programming Fundamentals
Welcome! 0 COMP1511 18s1 Programming Fundamentals COMP1511 18s1 Lecture 4 1 More Functions + Loops Andrew Bennett even more functions while loops 2 Before we begin introduce
More informationClustering Color/Intensity. Group together pixels of similar color/intensity.
Clustering Color/Intensity Group together pixels of similar color/intensity. Agglomerative Clustering Cluster = connected pixels with similar color. Optimal decomposition may be hard. For example, find
More informationControl Flow: Branching booleans and selection statements CS GMU
Control Flow: Branching booleans and selection statements CS 112 @ GMU Topics booleans selection statements: if if-else if-elif(s) if-elif(s)-else flow charts 2 Booleans Booleans - examples Booleans are
More informationIntroduction to Programming
Introduction to Programming Python Lab 7: if Statement PythonLab7 lecture slides.ppt 14 November 2017 Ping Brennan (p.brennan@bbk.ac.uk) 1 Getting Started Create a new folder in your disk space with the
More informationThe following content is provided under a Creative Commons license. Your support
MITOCW Recitation 1 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To make
More informationCSE 341, Autumn 2005, Assignment 3 ML - MiniML Interpreter
Due: Thurs October 27, 10:00pm CSE 341, Autumn 2005, Assignment 3 ML - MiniML Interpreter Note: This is a much longer assignment than anything we ve seen up until now. You are given two weeks to complete
More information10 things you should know about Word 2010's mail merge tools
10 things you should know about Word 2010's mail merge tools By Katherine Murray December 6, 2010, 10:26 AM PST Takeaway: Word s mail merge process has traditionally been viewed as intimidating and complex.
More informationContracts and Abstraction Casts Checking a Type Interfaces
Contracts and Abstraction Casts Checking a Type Interfaces 1 Contracts What is the contract for the equals method of String? "hello".equals() 2 Contracts What is the contract for the equals method of String?
More information1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.
1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document. 2. W3Schools has a lovely html tutorial here (it s worth the time): http://www.w3schools.com/html/default.asp
More informationCSCI 6610: Review. Chapter 7: Numbers Chapter 8: Characters Chapter 11 Pointers
... 1/27 CSCI 6610: Review Chapter 7: Numbers Chapter 8: Characters Chapter 11 Pointers Alice E. Fischer February 1, 2016 ... 2/27 Outline The Trouble with Numbers The char Data Types Pointers ... 3/27
More informationName & Recitation Section:
Name & Recitation Section: Due Thursday, Jan 13 at 2:10 PM in 34-101. Please print out your code files (homework 3.py, queue.py, and any code you wrote for optional problems), and staple them to the back
More informationProblem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur
Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 15 Branching : IF ELSE Statement We are looking
More informationCS 221 Lecture. Tuesday, 4 October There are 10 kinds of people in this world: those who know how to count in binary, and those who don t.
CS 221 Lecture Tuesday, 4 October 2011 There are 10 kinds of people in this world: those who know how to count in binary, and those who don t. Today s Agenda 1. Announcements 2. You Can Define New Functions
More informationHomework #2. If (your ID number s last two digits % 6) = 0: 6, 12, 18
2005/Sep/19 1 Homework #2 Chapter 1: Exercises 7, 9 with modifications: for Exercise 7.a: 20 and 32 are changed as your ID number s last two digits and 60. for Exercise 9: 47x25 are change as 47x(your
More informationPerl Basics. Structure, Style, and Documentation
Perl Basics Structure, Style, and Documentation Copyright 2006 2009 Stewart Weiss Easy to read programs Your job as a programmer is to create programs that are: easy to read easy to understand, easy to
More informationC++ Data Types. 1 Simple C++ Data Types 2. 3 Numeric Types Integers (whole numbers) Decimal Numbers... 5
C++ Data Types Contents 1 Simple C++ Data Types 2 2 Quick Note About Representations 3 3 Numeric Types 4 3.1 Integers (whole numbers)............................................ 4 3.2 Decimal Numbers.................................................
More informationCSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel
CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel We will now discuss computer programs, a concrete manifestation of what we ve been calling
More informationGenome Sciences 373: Genome Informatics. Quiz section #1 March 29, 2018
Genome Sciences 373: Genome Informatics Quiz section #1 March 29, 2018 About me Email: hpliner@uw.edu Office hours: Thursday right after quiz section (2:20pm) Foege S110 Or by appointment Other help: I
More informationBlu Ray Burning in MZ280 Step 1 - Set Toast up to burn a Blu-ray Video Disc.
Blu Ray Burning in MZ280 Step 1 - Set Toast up to burn a Blu-ray Video Disc. Open Toast. On the main screen, click the Video button in the upper-left portion of the screen, and select Blu-ray Video from
More informationUsing the MIPS Calling Convention. Recursive Functions in Assembly. CS 64: Computer Organization and Design Logic Lecture #10 Fall 2018
Using the MIPS Calling Convention Recursive Functions in Assembly CS 64: Computer Organization and Design Logic Lecture #10 Fall 2018 Ziad Matni, Ph.D. Dept. of Computer Science, UCSB Administrative Lab
More informationEGR 111 Loops. This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times.
EGR 111 Loops This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times. New MATLAB commands: for, while,, length 1. The For Loop Suppose we want print a statement
More information1. The programming language C is more than 30 years old. True or False? (Circle your choice.)
Name: Section: Grade: Answer these questions while viewing the assigned videos. Not sure of an answer? Ask your instructor to explain at the beginning of the next class session. You can then fill in your
More informationCreate Reflections with Images
Create Reflections with Images Adding reflections to your images can spice up your presentation add zest to your message. Plus, it s quite nice to look at too So, how will it look? Here s an example You
More informationAlgorithm Design and Recursion. Search and Sort Algorithms
Algorithm Design and Recursion Search and Sort Algorithms Objectives To understand the basic techniques for analyzing the efficiency of algorithms. To know what searching is and understand the algorithms
More informationQUESTIONS ACTIONS IN GAMEMAKER
QUESTIONS ACTIONS IN GAMEMAKER Questions Actions are useful actions that come in handy when you need to check things, such as whether something exists, if there is a collision, if two values are the same
More informationLoops and Switches Pre-Quiz
Loops and Switches Loops and Switches Pre-Quiz 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give an example of a program
More informationHOW-TO ACCESS REPORTS IN DELPHI. 3. Click on the Reports tab near the top. Your screen should now look like this:
HOW-TO ACCESS REPORTS IN DELPHI 1. Go to http://delphi.pqcnc.org/. 2. Log in with you username and password 3. Click on the Reports tab near the top. Your screen should now look like this: 4. Click on
More informationCOMP 364: Computer Tools for Life Sciences
COMP 364: Computer Tools for Life Sciences Algorithm design: Linear and Binary Search Mathieu Blanchette, based on material from Christopher J.F. Cameron and Carlos G. Oliver 1 / 24 Algorithms An algorithm
More informationPrivacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras
Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 08 Tutorial 2, Part 2, Facebook API (Refer Slide Time: 00:12)
More informationAdmin. How's the project coming? After these slides, read chapter 13 in your book. Quizzes will return
Recursion CS 1 Admin How's the project coming? After these slides, read chapter 13 in your book Yes that is out of order, but we can read it stand alone Quizzes will return Tuesday Nov 29 th see calendar
More informationCSE 143: Computer Programming II Winter 2019 HW6: AnagramSolver (due Thursday, Feb 28, :30pm)
CSE 143: Computer Programming II Winter 2019 HW6: AnagramSolver (due Thursday, Feb 28, 2019 11:30pm) This assignment focuses on recursive backtracking. Turn in the following files using the link on the
More informationTesting. UW CSE 160 Winter 2016
Testing UW CSE 160 Winter 2016 1 Testing Programming to analyze data is powerful It s useless (or worse!) if the results are not correct Correctness is far more important than speed 2 Famous examples Ariane
More informationLecture 8 CSE11 Fall 2013 While Loops, Switch Statement, Simplifying Conditionals
Lecture 8 CSE11 Fall 2013 While Loops, Switch Statement, Simplifying Conditionals What are Computers Really Good at? Complex calculations Repetitive tasks Identifying repetition is key to many programming
More informationModule 3: Representing Values in a Computer
Module 3: Representing Values in a Computer Due Dates Assignment #1 is due Thursday January 19th at 4pm Pre-class quiz #4 is due Thursday January 19th at 7pm. Assigned reading for the quiz: Epp, 4th edition:
More informationCS177 Recitation. Functions, Booleans, Decision Structures, and Loop Structures
CS177 Recitation Functions, Booleans, Decision Structures, and Loop Structures Functions Collection of instructions that perform a task as: o Printing your name and course. o Calculating the average of
More informationGrade 6 Math Circles October 16 & Non-Euclidean Geometry and the Globe
Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles October 16 & 17 2018 Non-Euclidean Geometry and the Globe (Euclidean) Geometry Review:
More informationCS 221 Lecture. Tuesday, 13 September 2011
CS 221 Lecture Tuesday, 13 September 2011 Today s Agenda 1. Announcements 2. Boolean Expressions and logic 3. MATLAB Fundamentals 1. Announcements First in-class quiz: Tuesday 4 October Lab quiz: Thursday
More informationStaying Safe on the Internet. Mark Schulman
Staying Safe on the Internet Mark Schulman 1 Your Presenter Mark Schulman IT professional for almost 40 years No affiliation with any product 2 What We ll Talk About Passwords Email Safety Staying Safe
More information