Programming Techniques

Slides:



Advertisements
Similar presentations
OO Programming in Java Objectives for today: Constructors Method Overriding & Overloading Encapsulation.
Advertisements

Sub and Function Procedures
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-
1 Procedural Programming Paradigm Stacks and Procedures.
A Level Computing#BristolMet Session Objectives#U2 S8 MUST identify the difference between a procedure and a function SHOULD explain the need for parameters.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
Structured programming
Introduction to Python
Chapter 41 General Procedures Sub Procedures, Part I Sub Procedures, Part II Function Procedures.
Python.
The University of Texas – Pan American
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 7 Sub and Function Procedures.
Subprograms CE 311 K - Introduction to Computer Methods Daene C. McKinney.
Chapter 9: Writing Procedures Visual Basic.NET Programming: From Problem Analysis to Program Design.
Python Programming Using Variables and input. Objectives We’re learning to build functions and to use inputs and outputs. Outcomes Build a function Use.
Lesson 6. Python 3.3 Objectives. In this lesson students will learn how to output data to the screen and request input from the user. Students will also.
Variables When programming it is often necessary to store a value for use later on in the program. A variable is a label given to a location in memory.
ME 142 Engineering Computation I Exam 2 Review VBA.
ProgLan Python Session 4. Functions are a convenient way to divide your code into useful blocks, allowing us to: order our code, make it more readable,
Algorithms and Computer Programming. Algorithms algorithm is an ordered sequence of instructions for solving a problem. Look at it as a building blocks.
Higher Computing Science 2016 Prelim Revision. Topics to revise Computational Constructs parameter passing (value and reference, formal and actual) sub-programs/routines,
G043: Lecture 12 Basics of Software Development Mr C Johnston ICT Teacher
Programming Right from the Start with Visual Basic .NET 1/e
Chapter 9 Repetition.
3.1 Fundamentals of algorithms
Exam 2 Review.
Web Design II Flat Rock Community Schools
Functions and Procedures
Organization of Programming Languages
C-language Lecture By B.S.S.Tejesh, S.Neeraja Asst.Prof.
Functions in C Mrs. Chitra M. Gaikwad.
An Introduction to Visual Basic .NET and Program Design
Buy book Online -
TASK: Define the memory keywords.
Learning to Program in Python
Subroutines Web Programming.
Functions and Procedures
Functions A function is a “pre-packaged” block of code written to perform a well-defined task Why? Code sharing and reusability Reduces errors Write and.
Log onto a computer first then ….
Programming in Pseudocode
CSE 115 September 29 – October 3, 2008.
Passing Parameters by value
The while Looping Structure
CSE 115 September 29 – October 3, 2008.
Functions Christopher Harrison | Content Developer
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Procedures: Functions and Subroutines
The structure of programming
Summary of what we learned yesterday
FUNCTION.
Functions, Return Values, Parameters Getters and Setters
Introduction to Computer Science
Introduction to Computer Science
The structure of programming
Introduction to Python
The while Looping Structure
Thinking procedurally
Starter Which of these inventions is: Used most by people in Britain
Programming Concepts and Database
What you need to do… Drag the pieces of code into the correct order like you can see in the EXAMPLE below. print ( “ int input ) = + Hello world chr ord.
CPS125.
Variables, Constants, Assign.
10.2 Procedures Passing Parameters 30/08/2019.
Programming Techniques
Programming Techniques
Programming Techniques
Programming Techniques
Inputs, Outputs and Assignment
Presentation transcript:

Programming Techniques Keywords Parameter, Function, Procedure, Argument, Variable, Program. Programming Techniques Sub Programs

Why use sub programs? Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Sub programs can be used to save time and simplify code. The main types of sub programs are procedures and functions. When you want your program to repeat in different places you only need to call the name of the sub program. This saves time and simplifies code by avoiding repetition of code. Starter activity

Procedure Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Procedures are sets of instructions stored under one name (identifier). Starter activity If we call name() and input Jon it would output: Hello Jon

Function Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Functions are similar to procedures but always return a value to the main program. Starter activity

Parameter and Arguments Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. A Parameter is a special name given to a variable that is passed into a sub function. It is worth noting that both procedures and functions can take in parameters. An argument is the name given to the actual values when the sub program is called. Starter activity

Task 90-100 = A* 80-89 – A 70 – 79 – B 60 – 69 – C <60 - Fail Objectives BEGINNER: Define a sub program in computing. ADVANCED: Explain functions, procedures, parameters and arguments. EXPERT: Develop a program that uses a function. Write a function called GradeCalculator() that converts an exam result to a grade using the following boundaries: 90-100 = A* 80-89 – A 70 – 79 – B 60 – 69 – C <60 - Fail Starter activity Can you create pseudo code and then write the program in python?