Reviewing key concepts

Slides:



Advertisements
Similar presentations
Driving Test 1 Marking Scheme Focus on five areas to pass driving test 1.
Advertisements

© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Fundamentals of Strings and Characters Characters.
Review for midterm exam Dilshad M. Shahid Spring NYU.
Guide To UNIX Using Linux Third Edition
JAVASCRIPT TIPS. REMEMBER JAVASCRIPT IS VERY, VERY CASE SENSITIVE.
THE BIG PICTURE. How does JavaScript interact with the browser?
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
Variables "There are 10 kinds of people in the world today – those who understand binary and those who don't!” Unknown.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
Today’s Lecture  Literal  Constant  Precedence rules  More assignment rules  Program Style.
Variables 1. What is a variable? Something whose value can change over time This value can change more than once over the time period (no limit!) Example:
JavaScript VARIABLES AND DATA TYPES. OUTPUT WITHOUT ALERT OR FORM CONSOLE.LOG();
JavaScript Functions. CSS Inheritance Which formatting applies? x y z input { display: block; } input.pref { background:red; } If you have a selector.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Programming for GCSE Topic 8.1: Functions T eaching L ondon C omputing William Marsh School of Electronic Engineering and Computer Science Queen Mary University.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
 Collection of statements that can be invoked as a unit  Can take parameters  Can be used multiple times  Can call without knowing what they do or.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
CSC 108H: Introduction to Computer Programming
Recap: Key ideas in WordGames
Precedence Operators Error Types
Learning to Program D is for Digital.
May 17th – Comparison Sorts
Web Design II Flat Rock Community Schools
Variables and Data Types
JavaScript functions.
constructing simple procedures using abstraction
Testing UW CSE 160 Winter 2017.
JavaScript, continued.
Accumulators in Programming
JavaScript Functions.
JavaScript.
Introduction to Objects
Testing UW CSE 160 Spring 2018.
Functions Inputs Output
Efficiency (Chapter 2).
Console.
Topics Introduction to File Input and Output
Javascript: variables and parameters
JavaScript Functions.
Testing UW CSE 160 Winter 2016.
We are starting to program with JavaScript
T. Jumana Abu Shmais – AOU - Riyadh
Programming in JavaScript
Variables and Data Types
Programming in JavaScript
Writing Functions.
We are starting JavaScript. Here are a set of examples
Workshop for Programming And Systems Management Teachers
How would you use your calculator to solve 52?
Programming in JavaScript
An Introduction to JavaScript
Programming in JavaScript
Programming in JavaScript
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Chapter 20: Programming Functions
Programming in JavaScript
Programming in JavaScript
Introducing JavaScript
JavaScript functions.
Javascript Chapter 19 and 20 5/3/2019.
Writing to the Page Formatting Forms
Topics Introduction to File Input and Output
Functions, Procedures, and Abstraction
Intro to Programming (in JavaScript)
Introduction to Computer Science and Object-Oriented Programming
Introduction to Objects
Presentation transcript:

Reviewing key concepts JavaScript Reviewing key concepts

3 BIG IDEAS Assignment Statements Functions Forms

Idea 1: assignment statements

Holding information A computer doesn’t understand values It takes locations and does what you tell it It knows about “cubby holes” A JavaScript Statement Takes information from a cubby hole Does what you say And then puts it where you say Holding information

A = B + C; Cubby Hole 2: add this value Cubby Hole 3: place it here Cubby Hole 1: take this value example

CUBBY HOLES 3 types of cubby holes Differences Fields in a form Function input and output Specially defined ones Differences Some you can only read Some you can only write Some you can do both CUBBY HOLES

using Functions

Output Black Box Inputs

Return Parameters Function Cubby hole I can just write Cubby holes I can just read

Isolation A function can be called from ANYWHERE It knows nothing about the outside world You need to tell it EVERYTHING it needs Isolation

The rules The order of the parameters matter Only a single output 5 - 3 different than 3 -5 Any number of parameters can be defined Fixed for any specific function Only a single output Optional in general Same for any specific function The rules

Returning a value Use the function as a value Contrast with form.field.value = function(parm1, parm2); difference = subtract(minuhend,subtrahend); Contrast with alert(string); append(form.field.value,’end’); Returning a value

creating Functions

Writing: alert, log Conversions: strings and numbers Many more: google them Existing functions

Need to define Inputs Outputs What to do Building our own

Inputs: read only These are the parameters Order matters Need a way to reference them Position 1, position 2, … Cubby holes Better to use meaningful names Each name is just a pointer to the cubby hole Inputs: read only

output: write once Use a RETURN statement A write-once cubby hole Only way to access is the RETURN statement Once you set it, the function is ended Can have a simple value or more (e.g., concatenating strings) output: write once

WHAT TO DO Series of statements: the recipe Can use Assignment statements Function calls Can use Literals (5, “ “) parameters Specially defined locations (variables) WHAT TO DO

Idea 3: Forms

Form fields are cubby holes Two cubby holes that we have learned about: value: something that can be changed src: the picture file Form fields are cubby holes