Intro to Programming (in JavaScript)

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
V Avon High School Tech Club Agenda Old Business –Delete Files New Business –Week 16 Topics: Intro to HTML/CSS –Questions? Tech Club Forums.
Using Control Structures. Goals Understand the three basic forms of control structures Understand how to create and manage conditionals Understand how.
Advanced Web Design Scripting Tutorial Chapters. Scripting Intro The scripting part of the forthcoming Advanced Web Design textbook introduces you to.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
THE BIG PICTURE. How does JavaScript interact with the browser?
Chapter 3: Data Types and Operators JavaScript - Introductory.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
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
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
Intro to PHP IST2101. Review: HTML & Tags 2IST210.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
CST336, Dr. Krzysztof Pietroszek Week 2: PHP. 1.Introduction to PHP 2.Embed PHP code into an HTML web page 3.Generate (output HTML) web page using PHP.
PHP Form Processing * referenced from
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
CMSC201 Computer Science I for Majors Lecture 05 – Comparison Operators and Boolean (Logical) Operators Prof. Katherine Gibson Prof. Jeremy.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
Foundations of Programming: Java
PHP using MySQL Database for Web Development (part II)
CMSC201 Computer Science I for Majors Lecture 05 – Comparison Operators and Boolean (Logical) Operators Prof. Katherine Gibson Based on slides by Shawn.
>> Introduction to JavaScript
Tutorial 10 Programming with JavaScript
2.5 Another Java Application: Adding Integers
Programming Mehdi Bukhari.
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Introduction to Scripting
Introduction to JavaScript
PHP Introduction.
JavaScript.
Exercises on JavaScript & Revision
WEB PROGRAMMING JavaScript.
PHP Intro/Overview Bird Book pages 1-11,
PHP.
T. Jumana Abu Shmais – AOU - Riyadh
Programming in JavaScript
Coding Concepts (Basics)
Computer Science Core Concepts
HYPERTEXT PREPROCESSOR BY : UMA KAKKAR
Tutorial 10 Programming with JavaScript
Programming in JavaScript
Python Basics with Jupyter Notebook
Relational Operators.
Using Decision Structures
JavaScript CS 4640 Programming Languages for Web Applications
Tutorial 10: Programming with javascript
Introducing JavaScript
JavaScript: Introduction to Scripting
Javascript Chapter 19 and 20 5/3/2019.
PHP an introduction.
Introduction to JavaScript
Web Programming and Design
This is an introduction to JavaScript using the examples found at the CIS17 website. In previous examples I specified language = Javascript, instead of.
CS105 Introduction to Computer Concepts JavaScript
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

Intro to Programming (in JavaScript)

What is programming, anyway?

Programming gives computers a series of instructions… And it all renders down to binary (0s and 1s)!

Programming Languages There are SO MANY programming languages… today we’re learning JavaScript, an easy language to get started with.

JavaScript Doesn’t really have anything to do with Java Executed by web browsers (usually) GREAT language to learn Very in-demand due to growing popularity of JavaScript frameworks for front-end (user interface) and back-end (server) development

Let’s get started… You don’t need a code editor to write JavaScript. You can use anything, even just Notepad. We are going to create an HTML file, like we did Monday, and write the JavaScript there.

Instructions: Getting Started Open Notepad Type the HTML code on the right side of this slide. Save the file as learnjs.html Change save as type to All Files Then double-click the saved file to open it in a web browser

Basic Processing Change your previous code to the following… Save the file and refresh the page in your browser Let’s break it down…

Variables Store information to be accessed and/or processed later

Variables Can be used virtually anywhere in your code

Variable Types JavaScript variables are loosely assigned, so you don’t need to declare a variable type When you work with some other languages, this will not be the case! Common variable types: String: “this is text!” Integer: 4 Double: 4.2 Boolean: false

Working with Different Variable Types

Working with Concatenation

Conditional Statements Now let’s ask the computer to make some decisions!

Conditional Statements Change the number in the conditional statement

If… else

If… else if… else

Comparison Operators > greater than >= greater than or equal to < less than <= less than or equal to == equals !== does not equal

You try it! Create a variable x with a value of 11 Create a variable y with a value of 15 Write a conditional statement to check if x is greater than y. If so, output the result of x + y But, if x is less than y, output the result of y - x What is the result?

Loops Sometimes, we need to perform an action repeatedly while a condition is satisfied – for this, we have loops! How would you add a space between each number displayed?

Functions Sometimes, we want to define instructions that can be repeated multiple times…

Functions Or, triggered from HTML!

HTML Forms

Processing HTML Forms

Objects/Classes Very important programming concept Objects are used to organize code, prevent coding errors, and define a set of functions and variables relevant only to their intended scope

Object Parameters Sometimes, we want to create an object with established parameters from the beginning These are created in the constructor

Bringing It Together…