Did a few weeks ago. tag would work..

Slides:



Advertisements
Similar presentations
Chapter 2 Review Questions
Advertisements

July 13 th.  If/ Else if / Else  Variable Scope  Nested if/else's  Switch statements  Conditional Operator.
Slides prepared by Rose Williams, Binghamton University Chapter 3 Flow of Control Loops in Java.
Topics: Linear Inequalities Systems of Linear Equations Inequalities.
JavaScript Events and Event Handlers 1 An event is an action that occurs within a Web browser or Web document. An event handler is a statement that tells.
Transparency 2 Click the mouse button or press the Space Bar to display the answers.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
OPERATIONEXPLANATIONEXAMPLE Converting a decimal to a percent Move the decimal point 2 places to the right and add a percent (%) sign. If you need to,
COMPUTER PROGRAMMING. Iteration structures (loops) There may be a situation when you need to execute a block of code several number of times. In general,
Logic and Control. 4-2 Decision (selection) structure: if (condition) { statement etc. } Example: if (age == 15) { document.write(“ you are a fifteen”);
L OO P S While writing a program, there may be a situation when you need to perform some action over and over again. In such situation you would need.
Intro to JavaScript. Some simple examples Examples from our webpage Examples from Andrews webpage Today’s Example.
JavaScript Syntax, how to use it in a HTML document
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
1 ENGI 2420 Structured Programming (Lab Tutorial 5) Memorial University of Newfoundland.
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.
Intelligent Numerical Computation1 Numerical Analysis Basic structures of a flowchart Solving a nonlinear equation with one variable Bisection method Newton.
Answer questions about assignment.. Starting JavaScript, at my site these examples are under programs and JavaScript. You can see the address for this.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
What will each of the following lines print? System.out.println("number" ); number645 System.out.println("number" + (6 + 4)+ 5); number105 System.out.println(6.
This is a while loop. The code is done while the condition is true. The code that is done is enclosed in { }. Note that this program has three parts: Housekeeping.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
1.Read and review the coordinate point task that you are given. 2.Open the “Geometry Pad” app. 3.Plot each ordered pair, as directed by your task, using.
MGT 311 Week 4 DQ 4 What is the difference between the position a person holds in a company and their political power? Is the top executive in an organization.
PHP using MySQL Database for Web Development (part II)
CHAPTER 10 JAVA SCRIPT.
“Under the hood”: Angry Birds Maze
Loops BIS1523 – Lecture 10.
EGR 2261 Unit 4 Control Structures I: Selection
Think What will be the output?
Starter Write a program that asks the user if it is raining today.
Prime, Composite, FACTORS, and Multiples
For Loops October 12, 2017.
Iteration with While You can say that again.
More Selections BIS1523 – Lecture 9.
Functions BIS1523 – Lecture 17.
LRobot Game.
More Loops.
More Loops.
Introduction to Java, and DrJava part 1
Laptop Instrument Meeting 4 January 29, 2018.
We are starting to program with JavaScript
Lesson 2: Input and Variables
The Web Wizard’s Guide To JavaScript
T. Jumana Abu Shmais – AOU - Riyadh
Solving Equations with Variables on Both Sides Day 2
JavaScript What is JavaScript? What can JavaScript do?
Three Special Structures – Case, Do While, and Do Until
Dividing Rational Numbers
Conditionals.
Homework Any Questions?.
JavaScript Part 2.
Introduction to Java, and DrJava
JavaScript What is JavaScript? What can JavaScript do?
Training & Development
JavaScript.
Relational Operators.
Loops.
Developing a Program.
Javascript Chapter 19 and 20 5/3/2019.
Introduction to Java, and DrJava part 1
75 previous answer What is of 37.5? ? go to.
Solving Equations with Variables on Both Sides Day 2
Web Programming and Design
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.
75 previous answer What is of 60? ? go to.
True or False True or False
Presentation transcript:

did a few weeks ago. tag would work.

Declare variables - note the ; at the end of the line. This shows the loop - I put the test at the end so the loop always gets executed once - knowing the data, this was fine but in other situations I might use other code. Note that the if is enclosed in { }. True False writes on the screen.

The if statement has the conditions in parenthesis and the code if true enlosed in one set of { } and the code if false enclosed in another { }. These also tell us when the if has ended.

This program, like the previous one, was executed when I clicked on the link and the result was displayed using document.write which writes on the document in the browser (the screen).

if (workAns == thirdNum) This means that fourth/Num is divided by 2 and the answer is assigned back to fourthNum, changing what is in fourthNum. Note that the = is an assignment sign that assigns the calculation on the right to the variable on the left.