Programming Week 5 LBSC 690 Information Technology.

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Thursday, September 19, 2013 Session 3: JavaScript.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
The Web Warrior Guide to Web Design Technologies
Programming Class 9 LBSC 690 Information Technology.
Programming Week 9 LBSC 690 Information Technology.
Multimedia and the World Wide Web HCI 201 Lecture Notes #8B.
1 HCI 201 JavaScript - Part 1. 2 Static web pages l Static pages: what we have worked with so far l HTML tags tell the browser what to do with the content.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Web Infrastructure Week 3 INFM 603. The Key Ideas Questions Structured Programming Modular Programming Data Structures Object-Oriented Programming.
LBSC 690 Session #10 Programming, JavaScript Jimmy Lin The iSchool University of Maryland Wednesday, November 5, 2008 This work is licensed under a Creative.
Programming Week 5 LBSC 690 Information Technology.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
LBSC 690: Session 10 Programming, JavaScript Jimmy Lin College of Information Studies University of Maryland Monday, November 12, 2007.
Databases Week 6 LBSC 690 Information Technology.
Programming Week 6 LBSC 690 Information Technology.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Web Programming Material From Greenlaw/Hepp, In-line/On-line: Fundamentals of the Internet and the World Wide Web 1 Introduction The JavaScript Programming.
CS102 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1GMS-VU : Module 2 Introduction to Information and Communication Technologies Module 2 Computer Software.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
Javascript and the Web Whys and Hows of Javascript.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Microsoft Visual Basic 2005: Reloaded Second Edition
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Generations of Programming Languages First generation  Machine Language Second Generation  Assembly Language Third Generation  Procedural language such.
JavaScript II ECT 270 Robin Burke. Outline JavaScript review Processing Syntax Events and event handling Form validation.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
What is Java Script? An extension to HTML. An extension to HTML. Allows authors to incorporate some functionality in their web pages. (without using CGI.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
1 JavaScript in Context. Server-Side Programming.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Tutorial 10 Programming with JavaScript
Introduction to Computer Systems and the Java Programming Language.
Visual C++ Programming: Concepts and Projects
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
10/8: Software What is software? –Types of software System software: Operating systems Applications Creating software –Evolution of software development.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 8 Scott Marino.
1 A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 4 JavaScript and.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES.
The Module Road Map Assignment 1 Road Map We will look at… Internet / World Wide Web Aspects of their operation The role of clients and servers ASPX.
1 JavaScript in Context. Server-Side Programming.
Introduction to JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Programming Instructor: Joseph DiVerdi, Ph.D., MBA.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Programming Session 6 LBSC 690 Information Technology.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
The need for Programming Languages
“Under the hood”: Angry Birds Maze
Software Programming J. Holvikivi 2014.
Week 5 LBSC 690 Information Technology
“Under the hood”: Angry Birds Maze
Week 6 LBSC 690 Information Technology
Class 5 LBSC 690 Information Technology
Presentation transcript:

Programming Week 5 LBSC 690 Information Technology

Software Software models aspects of reality –Input and output represent the state of the world –Software describes how the two are related Examples –Ballistic computations –Alta Vista –Microsoft Word

Types of Software Application programs (e.g., Powerpoint) –What you normally think of as a “program’’ Compilers and interpreters –Programs used to write other programs Operating system (e.g., Windows XP) –M anages display, CPU, memory, disk, tape, E mbedded program (e.g., BIOS) –P ermanent software inside some device

Programming Languages Used to specify every detail of the model Special purpose –Able to specify an entire class of models Spreadsheets (Excel,...) Databases (Access, Oracle,...) General purpose –Able to specify any possible model JavaScript, Java, Perl, C, C++,...

History of Programming Machine language –Language that machine can understand Assembly language –Assembler changes names to machine code High-level languages –Compiler/Interpreter translates to machine language –FORTRAN, COBOL, C, C++, Javascript Visual programming language –Visually arrange the interface components –Visual Basic, …

Machine Language Everything is a binary number –Operations –Data For instance ADD first number (21) second number (86)

Assembly Language Symbolic instruction codes and addresses –Symbolic instruction code “ADD” –Symbolic address “SUM1” For instance ADD 21, SUM1

High level Languages Procedural (modular) Programming –Group instructions into meaningful abstractions –C, Pascal, Perl Object oriented programming –Group “data” and “methods” into “objects” –Naturally represents the world around us –C++, Java, JavaScript

Object Models Represent things in the world as “objects” –Simplest objects are “variables” Represented with a name (n, teacher, …) May be assigned a value (n=4, teacher=“Doug”, …) Represent actions with “methods” –Simplest methods are “operations” Represented with a symbol (+, -, *, /, ^, …) “Classes” group objects with methods –Models how kinds of things behave Objects are instances of classes

Data Types Boolean: true/false Numbers: 5, 9, Strings: “Hello World” Variables: f, celsius, Class: Temperature Instance: collegeParkTemperature Method:toCelsius(f)

Operations and Assignments -xreverse the sign of x (negation) 6+5Add 6 and 5 (numeric) “Hello” + “World” Concatenate two strings 2.1 * 3 Multiply two values x++increase value of x by 1 x = 5set the value of x to be 5 x += yx = x + y x *= 5x = x * 5

Function A set of codes for achieving a simple task Can be reused many times function toCelsius(f) { celsius = 5/9 * (f-32) return celsius }

Statements Simple assignment statements celsius = 5/9 * (f-32) Statements that invoke a method Temperature.toCelsius(104) Return a value from a method return celsius

Basic Control Structures Sequential Conditional Repetition

Sequential Control Structure a = 2 b = 3 c = a * b

Conditional Selection Control Structure if (gender == “male”) { greeting = “Hello, Sir” } else { greeting = “Hello, Madam” }

Comparisons x == y returns true if x and y are equal x != y returns true if x and y are not equal x > yreturns true if x is greater than y x <= y returns true if x is smaller than or equal to y x && yreturns true if both x and y are true x || yreturns true if either x or y is true !xreturns true if x is false

Repetition Control Structure Program Example 1: n = 1 while ( n <= 10) { document.writeln(n) n++ } Program 2: For (n = 1; n <= 10; n++) { document.writeln(n) }

Arrays A set of elements –For example, the number of days in each month Each element is assigned an index –A number used to refer to that element For example, x[4] is the fifth element (count from zero!) –Arrays and repetitions work naturally together

Programming for the Web Common Gateway Interface (CGI) [Server side] –Forms encode field values into a URL –CGI passes field values to a Perl program –Program generates a web page as a response JavaScript [Client-side, interpreted] –Human-readable “source code” sent to the browser –Web browser runs the program Java applets [Client-side, compiled] –Machine-readable “bytecode” sent to browser –Web browser runs the program

JavaScript My first script document.write("Hello, world!") Try it at

Handling Events Events: –actions that users perform while visiting the page –Embedded in modern GUI Use event handlers to response events –Event handlers triggered by events –Examples of event handlers in Javascript onMouseover: the mouse moved over an object onMouseout: the mouse moved off an object onClick: the user clicked on an object

A Simple rollover.html Open Netscape, not IE Type in URL Move mouse over and away the image View source –flyer, tank are variables (“new Image”) –flyer.src specifies the value –Event handlers “onMouseover” and “onMouseoff” –Name of the image is defined by NAME = “images” –<!– Hide script from old browsers … –If (document.images) { … to test browser function

Using Function Repetitive tasks => functions Load View sources Load r2.htm View sources –Function chgImg handle changing images for all –Program is shorter and clearer –document.textField equal to document[“textField”]

Hands On: Adopt a JavaScript Program Launch a Web browser –Internet Explorer would be the best choice See how it behaves if you are 13 (or 65) View source and read the program Save a local copy Make some changes and see how it works

JavaScript Resources Google “javascript” –More than you want to read Dr Allen’s javascript page – CHNOLOGY/JAVASCRIPT/ Engineering and Physical Sciences Library

Discussion Point: Mythical Person-Month Why is software development different from manufacturing car? If it would take one person three months, why does it take four people SIX months?

Programming is Creative Activity Three stages –Planning –Realization –testing Hard to estimate right Pressure to estimate too low Assume everything will go well

Estimating Completion Time Rules of thumb –1/3 specification –1/6 coding –1/2 test planning, testing, and fixing! Add time for coding to learn as you go, but don’t take time away from the other parts! –Reread the section on “gutless estimating” if you are tempted

Person /= Months Interchangeable only when partitions –not sequential constrained –not involve communication among them –no training needed Otherwise, –Keep sequential –Effort of communication added –Effort of training added –More people means more communications

Communications Sort of like continuous training –Who needs to know what I just learned? Can be minimized by good partitioning –Limit the number of interfaces Can be facilitated by computers –Asynchronous communication techniques , private newsgroups, voice mail