Functions and Parameters. Structured Programming.

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

COM311H Zheng, School of C&M, UUJ1 Dynamic Web Authoring JavaScript Basics (Array and Function)
Chapter 7: Sub and Function Procedures
The Information School of the University of Washington Oct 23 fit functions 1 Functions / If Else INFO/CSE 100, Fall 2006 Fluency in Information.
Tutorial 10 Programming with JavaScript
Web-based Application Development Lecture 13 February 21, 2006 Anita Raja.
Copyright © by The McGraw-Hill Companies, Inc. All rights reserved.Glencoe Accounting Employers are legally required to make tax deposits on time and.
Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Chapter 10 Employer Payroll Tax Reporting.
Debugging JavaScript CS346. IE Javascript Debugging Aids From IE6 on default: no debugging aid for Javascript Change setting: – Tools > Internet Options.
JAVASCRIPT HOW TO PROGRAM -2 DR. JOHN P. ABRAHAM UTPA.
Javascript and the Web Whys and Hows of Javascript.
Year End Processing Financial Management 1Freedom Systems - Year End Processing Webinar WELCOME TO THE YEAR END PROCESSING WEBINAR WE WILL BE WITH YOU.
Payroll Liabilities and Tax Records
XForms: A case study Rajiv Shivane & Pavitar Singh.
Programming with JavaScript (Chapter 10). XP Various things Midterm grades: Friday Winter Career Fair – Thursday, April 28, 2011 (11 am to 3 pm). – MAC.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
JavaScript II ECT 270 Robin Burke. Outline JavaScript review Processing Syntax Events and event handling Form validation.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
1 Lesson 7 Using Images with JavaScript HTML and JavaScript BASICS, 4 th Edition Barksdale / Turner.
Taxes: How it works First we need an income an income Write down.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Copyright © by The McGraw-Hill Companies, Inc. All rights reserved.Glencoe Accounting Employers are legally required to make tax deposits on time and.
Employee Empowerment Natural ly: Payroll What If s on the Web David Wimberly University of Arkansas
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
GOALS BUSINESS MATH© Thomson/South-WesternLesson 2.1Slide 1 2.1Deductions from Gross Pay Find federal withholding tax deductions Calculate social security.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
LESSON 12-1 Preparing Payroll Time Cards
Section 3Tax Liability Payments and Tax Reports What You’ll Learn  How to pay payroll tax liabilities.  Which tax reports are prepared and filed. What.
JavaScript - A Web Script Language Fred Durao
CSCE 102 – Chapter 9 (Functions and Parameters) CSCE General Applications Programming Benito Mendoza Benito Mendoza 1 By Benito Mendoza.
1 Copyright © 2004, Oracle. All rights reserved. Introduction to PL/SQL.
Intro to JavaScript. Some simple examples Examples from our webpage Examples from Andrews webpage Today’s Example.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
CHAPTER 11. CHAPTER 11 OVERVIEW  Enable Payroll  Set Up Payroll  Create Employee List  Print Paychecks  Pay Payroll Liabilities  Print Payroll Forms.
1 5.4 Modular Design Top-Down Design Structured Programming Advantages of Structured Programming.
JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.
CENTURY 21 ACCOUNTING © 2009 South-Western, Cengage Learning LESSON 3-2 Recording a Payroll and Payroll Taxes.
Introduction to Programming and JavaScript. Programming.
JavaScript Functions A function is a block of code that can be reused. It is similar to a method in Java. It consists of a function name, an argument.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 2 Murach's JavaScript and jQuery, C2© 2012, Mike Murach & Associates, Inc.Slide 1.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.
Host Objects: Browsers and the DOM
Payroll Liabilities and Tax Records Making Accounting Relevant Federal, state, and local governments pass tax laws in order to generate revenue for government.
JavaScript II ECT 270 Robin Burke. Outline Functions Events and event handling Form validation.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Tax Forms & Deductions. Net Income vs. Gross Income Gross income is the total amount a worker is paid before any required or voluntary deductions are.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript Wrap Up JavaScript is a versatile programming language … if you know it, you can learn others © 2004, Lawrence Snyder.
The Web Wizard’s Guide To JavaScript Chapter 4 Image Swapping.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 5 Host Objects: Browsers.
Chapter 3 Departmental Payroll. After the payroll register has been prepared, a check is written to transfer the total net pay amount from the regular.
Copyright © Terry Felke-Morris Web Development & Design Foundations with HTML5 8 th Edition CHAPTER 14 KEY CONCEPTS 1 Copyright.
JavaScript, Sixth Edition
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
© 2015, Mike Murach & Associates, Inc.
Intro to JavaScript CS 1150 Spring 2017.
Section 17.1 Section 17.2 Add an audio file using HTML
Programming the Web using XHTML and JavaScript
JavaScript Introduction
Payroll Management 12-3.
EMPLOYER ANNUAL REPORT TO EMPLOYEES OF TAXES WITHHELD
The Internet 11/29/11 Functions
The Web Wizard’s Guide To JavaScript
The Internet 11/22/11 Conditionals and Loops
Presentation transcript:

Functions and Parameters

Structured Programming

Modular, Structured Programs Program: –Sequences, conditionals, and loops. –Cohesive blocks of code. –Request that blocks of code do work.  Transition to objects.

Task Generate payroll for employees.

Steps Retrieve employee information. Retrieve payroll data for employee. Calculate gross pay. Calculate federal income tax. Calculate FICA tax. Calculate state tax. Calculate net pay. Transfer net pay to employee account. Transfer taxes to tax liability accounts. Generate pay statement.

Structure Get Employee Data Retrieve employee information Retrieve payroll data for employee Calculate gross pay Calculate federal income tax Calculate FICA tax Calculate state tax Calculate net pay Transfer net pay to employee account Transfer taxes to tax liability accounts Compute Net Pay Deposit Funds Prepare Pay Statement Employees Remaining? Generate pay statement

Modules Get Employee Data Retrieve employee information Retrieve payroll data for employee Calculate gross pay Calculate federal income tax Calculate FICA tax Calculate state tax Calculate net pay Transfer net pay to employee account Transfer taxes to tax liability accounts Generate pay statement Compute Net Pay Deposit Funds Prepare Pay Statement Employees Remaining?

Benefits Easier programming. Easier, better testing – modules. Easier maintenance. Reusable modules.

Basic Functions

Function Module of code. Each function should: –Perform a well-defined task. –Be self contained. –Receive the minimum data to perform task. Return value is optional.

function popupMessage() { alert('Hello\nHow are you today?') } popupMessage() alert('Hello’)

Function Declaration function popupMessage() { alert('Hello\nHow are you today?') } declarationnameparameter list start of function code end of function code

Parameters

Function with Parameter function popupMessage(message) { alert(message) } parameter use of parameter in function popupMessage('Oh no!') show = 'JavaScript is fun!' popupMessage('show') popupMessage(show) function call using a parameter Oh no! JavaScript is fun!

Multiple Parameters function popupMessage(line1, line2) { alert(line1 + '\n' + line2) } popupMessage('Oh no!', 'Mr. Bill') show1 = 'JavaScript is fun!' show2 = 'HTML is easy' popupMessage(show1, show2) parameters function call with multiple parameters

Image Rollovers

Implementation Overview Precaching. Multiple images. OnMouseOver event. OnMouseOut event.

alert(document.images[0].src) alert(document.images.pic1.src) alert(document.getElementById('pic1').src) index id by id using method images collection Referencing Elements

getElementById document.getElementById(id).target target’s id property or method based on target’s type (e.g., img) Recommended for accessing HTML elements in JavaScript

Debugging

Techniques Browser options: –IE: Enable script error notifications. –Mozilla: Use JavaScript console. Debug messages: –Display “current position” alerts in code. –Display intermediate computations.

var screenHeight = 0 var screenWidth = 0 var usableHeight = 0 var usableWidth = 0 var verticalWaste = 0 var horizontalWaste = 0 screenHeight = screen.availHeight screenWidth = screen.availWidth usableHeight = document.body.clientHeight usableWidth = documnet.body.clientWidth verticalWaste = screenHeight - usableHeight horizontalWaste = screenWidth – usableWidth alert('Vertical Waste: ' + verticalWaste + '\n' + 'Horizontal Waste: ' + horizontalWaste) alert(‘ok so far’) alert(screenHeight)