Variables and Logic - PowerPoint PPT Presentation

About This Presentation
Title:

Variables and Logic

Description:

First you write a countdown function and use it to count down to the new year. Then you put the countdown function into an include file from which you use it ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 9
Provided by: FredTHof
Learn more at: http://www1.udel.edu
Category:

less

Transcript and Presenter's Notes

Title: Variables and Logic


1
Variables and Logic
  • Enabling Web Pages to Make Decisions

2
What Is a Variable?
  • In computing, a variable is a place in the
    computers RAM that remembers, or stores, the
    value of something changeable.
  • It is called a variable because its value is
    subject to change.
  • Chapter 10 teaches you how to work with two kinds
    of variables.

3
What Is a String Variable?
  • A string is a sequence of one or more
    alphanumeric characters.
  • A string variable is a place in computer memory
    that remembers, or stores, the alphanumeric
    characters in a string.

4
What Is a Numeric Variable?
  • A numeric variable is a place in computer memory
    that remembers, or stores, a number.
  • In a script, the numbers can be integers or
    floating point.
  • An integer is a whole number with no decimal
    point.
  • A floating point number has a decimal point with
    one or more numbers after the decimal point.

5
Clock Script
  • The clock script uses variables to display on
    screen the current date and time.
  • One of the best ways to learn about variables is
    to play with them.
  • Let us play with the variables in the clock
    script.

6
Chapter 11 Logic
  • Chapter 11 teaches you logic by having you
    program a weekly calendar.
  • If-Then statements give your scripts the power of
    making decisions.
  • Lets play with the calendar script and analyze
    how the If-Then statements work.

7
Functions and Includes
  • Chapter 12 teaches you how to create functions
    and includes.
  • First you write a countdown function and use it
    to count down to the new year.
  • Then you put the countdown function into an
    include file from which you use it to count down
    to your birthday.

8
Javascript Timing
  • Chris asked me to talk about how to do timing
    with JavaScript.
  • There is a timing function called setTimeout()
    which takes two parameters.
  • Lets take a look at how it works in the
    DomEffects example that we will be studying in
    Chapter 15.
Write a Comment
User Comments (0)
About PowerShow.com