Procedures and Functions. What are they? They are both blocks of code that can be reused to perform specific task. However there is a difference: Function-

Slides:



Advertisements
Similar presentations
User-Defined Functions Like short programs Can operate on their own data Can receive data from callers and return data to callers.
Advertisements

COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Order of operators: x ** y x * y, x / y, x // y, x % y x + y, x - y
Chapter 3: Modularization
Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Shell Programming 1. Understanding Unix shell programming language: A. It has features of high-level languages. B. Convenient to do the programming. C.
Python. What is Python? A programming language we can use to communicate with the computer and solve problems We give the computer instructions that it.
Describe the application and limits of procedural, object orientated and event driven programming. 
Functions.
Python quick start guide
1 Web-Enabled Decision Support Systems Objects and Procedures Don McLaughlin IE 423 Design of Decision Support Systems (304)
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
COMP 171: Functions, for loops and range John Barr Section 03 Slides by Toby Dragon.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Functions and subroutines – Computer and Programming.
Pseudo Code Possibly one of the hardest skills to get to grips with in learning a programming language is developing the ability to take a problem and.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 10 – Enhancing the Wage Calculator Application:
Stephen P. Carl - CS 2421 Recursion Reading : Chapter 4.
Do it now activity Last term we learnt about how data is represented in a computer and about how to identify different volumes of data. How many bits in.
Java Classes Methods Objects. Classes Classes We have been using classes ever since we started programming in Java Whenever we use the keyword class.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
Algorithms and Algorithm Analysis The “fun” stuff.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Functions, Procedures, and Abstraction Dr. José M. Reyes Álamo.
Python – May 11 Briefing Course overview Introduction to the language Lab.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
Procedural Programming Criteria: P2 Task: 1.2 Thomas Jazwinski.
Intro to Programming Web Design ½ Shade Adetoro. Programming Slangs IDE - Integrated Development Environment – the software in which you develop an application.
Sequencing The most simple type of program uses sequencing, a set of instructions carried out one after another. Start End Display “Computer” Display “Science”
INLS 560 – F UNCTIONS Instructor: Jason Carter.
Neal Stublen Breaking Down Tasks  Reduce large tasks into smaller units of code  Smaller units of code might be called any of the.
S-Functions in Simulink
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Algorithms and Computer Programming. Algorithms algorithm is an ordered sequence of instructions for solving a problem. Look at it as a building blocks.
Functions Part I (Syntax). What is a function? A function is a set of statements which is split off into a separate entity that can be used like a “new.
PYTHON FUNCTIONS. What you should already know Example: f(x) = 2 * x f(3) = 6 f(3)  using f() 3 is the x input parameter 6 is the output of f(3)
Create Stored Procedures and Functions Database Management Fundamentals LESSON 2.4.
Control Structure  What is control Structure?  Types of Controls  Use the control structure in VBScript.  Example Summery.
Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Third Edition by Tony Gaddis.
Java Fundamentals MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
GCSE COMPUTER SCIENCE Practical Programming using Python
Multimedia Summer Camp
Lesson 06: Functions Class Participation: Class Chat:
Computer Programming.
Exam #1 You will have exactly 30 Mins to complete the exam.
COMPUTATIONAL CONSTRUCTS
Java Course Review.
Web Design II Flat Rock Community Schools
Functions and Procedures
Functions CIS 40 – Introduction to Programming in Python
Functions.
EV3 On Brick Programming
String Manipulation.
Teaching London Computing
Functions, Procedures, and Abstraction
Chapter 24 (4th ed.): Creating Functions
Fundamentals of Programming
Functions and Procedures
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
CS 1111 Introduction to Programming Fall 2018
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
Lesson 06: Functions Class Chat: Attendance: Participation
Python 9 Mr. Husch.
Python 19 Mr. Husch.
Introduction to Value-Returning Functions: Generating Random Numbers
Python 19 Mr. Husch.
PHP Function and Array 05 CHAPTER Padasalai MOHAMED FAKRUDEEN
IST256 : Applications Programming for Information Systems
Programming Techniques
Presentation transcript:

Procedures and Functions

What are they? They are both blocks of code that can be reused to perform specific task. However there is a difference: Function- The word comes from mathematics. It calculates a value based on inputs. E.g. Input X Function= Multiply by 2 Output= 2X Procedure- A set of commands that can be executed in a certain order. They do not return values. E.g. run Function1 then run Function2

Languages can help you out Programming languages often contain built in function. These are often complex action that would otherwise take a lot of time to create by yourself. They save time and make it much simpler to code E.g. Python- input(), len(),.upper()

You also need to know about Parameters and Return Values Parameter- information given to a function or procedure (a numerical or other measurable factor forming one of a set that defines a system or sets the conditions of its operation) E.g. Python Return Values – Information that come out of a subroutine. Look it even says return.