Passing Arguments Question Example: IS1102 Exam Autumn 2001.

Slides:



Advertisements
Similar presentations
Chapter 6, Slide 1Starting Out with Visual Basic 3 rd Edition Chapter 6 Sub Procedures And Functions.
Advertisements

Good Programming Practices rules every programmer should know and follow.
1 5.3 Sub Procedures, Part II Passing by Value Passing by Reference Sub Procedures that Return a Single Value Debugging.
Μαθαίνοντας Python [Κ4] ‘Guess the Number’
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
Writing General Procedures Often you will encounter programming situations in which multiple procedures perform the same operation This condition can occur.
Write a program that allows a user to enter information relating to the name and salary details of an employee The user should be able to enter the name.
Example 2.
Chapter 5 - Menus, Sub Procedures, and Sub Functions  Menus - controls - properties and events –menu editor - create and change –defining menus - menu.
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
FYP Production Equipment Request Procedure Briefing Session 1 By Garry.
Functions Section 4.3. Last week, we were introduced to procedures Procedures are used in support of top- down program design. –They are used to create.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
Chapter 41 General Procedures Sub Procedures, Part I Sub Procedures, Part II Function Procedures.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Apply Sub Procedures/Methods and User Defined Functions
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
Tutorial 11 Using and Writing Visual Basic for Applications Code
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Chapter 2: Creating ActiveX Code Components By นภดล กมลวิลาศเสถียร Dept. of Computer Engineering, Prince of Songkla University Source: Mastering Visual.
Visual Basic I Programming
Why to Create a Procedure
5-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
E0001 Computers in Engineering Procedures: subprograms and functions.
Sub procedures School of Business Eastern Illinois University © Abdou Illia, Spring 2002 (Week 6, Friday 2/21/03)
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 6 Functions.
COMPUTER PROGRAMMING. Functions What is a function? A function is a group of statements that is executed when it is called from some point of the program.
Subprograms CE 311 K - Introduction to Computer Methods Daene C. McKinney.
110-G1 Motivation: Within a program, may have to perform the same computation over and over Many programs share the same computation (e.g. sorting) To.
Chapter 6 Sub Procedures
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
Chapter 4 - Visual Basic Schneider1 Chapter 4 General Procedures.
Sub Procedures. A Sub procedure is a block of code that is executed in response to an event. There are two types of Sub procedures, general procedures.
© 2006 ITT Educational Services Inc. Introduction to Computer Programming: Unit 10: Chapter 6: Slide 1 Unit 10 Sub Procedures and Functions Chapter 6 Sub.
3.9 to  Also refer to as Program  Contains set of instructions that tells the computer how to perform specific task.  Each line of code is referred.
Java Arrays and Methods MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
Procedural Programming Criteria: P2 Task: 1.2 Thomas Jazwinski.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
‘Tirgul’ # 2 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #2.
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Controls and Events. The Next Step In the first module, we discussed general problem solving In this module, we’ll apply what we learned, from specification.
CS 104 – Fall 2011 Exploring Computer Science Lecture 20: November 14, 2011 Procedural Abstraction and List Processing.
Arrays and others. Annoucement Today’s office hour move to Friday 1:00PM to 3:00PM Today’s office hour move to Friday 1:00PM to 3:00PM Today Today  Call.
CHAPTER SIX Reducing Program Complexity General Sub Procedures and Developer-defined Functions.
Visual Basic CDA College Limassol Campus COM123 Visual Programming 1 Semester B Lecture:Pelekanou Olga Week 5: Useful Functions and Procedures.
Sub Procedures; Passing Values Back From Sub Procedures Passing by reference Passing by value.
Controlling Program Flow with Decision Structures.
Oracle10g Developer: PL/SQL Programming1 Objectives Named program units How to identify parameters The CREATE PROCEDURE statement Creating a procedure.
Loop and repetition. Today Passing values to and back from Sub procedures Option Buttons Do While Loops For Loops Population Growth.
Copyright Ó Oracle Corporation, All rights reserved Debugging Triggers.
Chapter 4 - Visual Basic Schneider1 Chapter 4 General Procedures.
General Procedures Chapter 4. Different Procedures 4.1 Sub Procedures, Part I 4.2 Sub Procedures, Part II 4.3 Function Procedures 4.4 Modular Design (not.
Starting Out with Visual Basic.NET 2 nd Edition Chapter 6 Sub Procedures And Functions.
Copyright © 2014 Pearson Education, Inc. Chapter 6 Procedures and Functions.
National Diploma Unit 4 Introduction to Software Development Procedures and Functions.
Subroutines (PrArith, Math,projCP1, PrAdrProc, PrAdrProcFunc) Please use speaker notes for additional information!
Sub Procedures and Functions Visual Basic. Sub Procedures Slide 2 of 26 Topic & Structure of the lesson Introduction to Modular Design Concepts Write.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
Sub Procedures And Functions
Chapter 5 Functions DDC 2133 Programming II.
Functions CIS 40 – Introduction to Programming in Python
Method.
Microsoft Access Illustrated
Chapter 6 Sub Procedures
Subroutines Web Programming.
Libraries of Code Notes from Wilson, Software Design and Development Preliminary Course pp
The structure of programming
Presentation transcript:

Passing Arguments Question Example: IS1102 Exam Autumn 2001

Break it down 2 Variables declared at module level [General Declarations] cmdCalculate_Click (Event Procedure) Display (Sub Procedure) AddNum (Sub Procedure) IncrementNum (Function Procedure – returns a value)

Begin with event procedure (user click) Assigns values to variables Makes Calls to Procedures and Functions

AddNum Procedure: Watch out for argument (in brackets) Makes call to the function procedure (IncrementNum) Makes call to sub procedure (Display)

Function Procedure (IncrementNum) Changes variable values (watch out for local Vs module variables) Value is returned (IncrementNum)

Prints to Picturebox Watch out for NewNum (receiving passed value) If Statement checks value of Num4 and statements executed depending on result