CS 1150 – JavaScript Programming Lab TA – Sanjaya Wijeratne – Web Page -

Slides:



Advertisements
Similar presentations
CS 1150 – Lab #4 – Logic Circuits TA – Sanjaya Wijeratne – Web Page -
Advertisements

CS 1150 – Lab #15 – Networking TA – Sanjaya Wijeratne – Web Page -
CS 1150 – Lab #13 – Artificial Intelligence TA – Sanjaya Wijeratne – Web Page -
CS 1150 – Lab #16A & 16B – HTML TA – Sanjaya Wijeratne – Web Page -
CS 1150 – Lab #16A & 16B – HTML TA – Sanjaya Wijeratne – Web Page -
ISP 121 Algorithmsand Computer Programming. Why Know Simple Programming?  You can create powerful macros in Access / Excel / Word / ??? to manipulate.
Tonight’s JavaScript Topics 1 Conditional Statements: if and switch The Array Object Looping Statements: for, while and do-while.
CS 1150 – Lab #2 – Exploring Number Systems TA – Sanjaya Wijeratne – Web Page -
Lesson 4: Formatting Input Data for Arithmetic
Zhang Hongyi CSCI2100B Data Structures Tutorial 2
Computer Science 103 Chapter 3 Introduction to JavaScript.
CS101- Lecture 11 CS101 Fall 2004 Course Introduction Professor Douglas Moody –Monday – 12:00-1:40 – – –Web Site: websupport1.citytech.cuny.edu.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
CS 299 – Web Programming and Design Overview of JavaScript and DOM Instructor: Dr. Fang (Daisy) Tang.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
CS 1150 – Lab #2 – Exploring Number Systems TA – Sanjaya Wijeratne – Web Page -
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
CS 1150 – JavaScript Programming Lab TA – Sanjaya Wijeratne – Web Page -
 2004 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT
INE1020 Introduction to Internet Engineering Tutorial 8 All about Lab 6.
Welcome to CS 3260 Dennis A. Fairclough. Overview Course Canvas Web Site Course Materials Lab Assignments Homework Grading Exams Withdrawing from Class.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
CS 1150 – Lab #3 – Representing Numbers TA – Sanjaya Wijeratne – Web Page -
Topic: An Introduction to JavaScript - from Beginning JavaScript by Wilton (WROX)
Using Client-Side Scripts to Enhance Web Applications 1.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
JavaScript - A Web Script Language Fred Durao
CS 1150 – Lab #3 – Representing Numbers TA – Sanjaya Wijeratne – Web Page -
Software Development CSCI-1302 Lakshmish Ramaswamy.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
CS 1150 – Lab #8 – Using Algorithms for Painting TA – Sanjaya Wijeratne – Web Page -
1 JavaScript
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 10 - JavaScript/JScript: Control Structures II Outline 10.1Introduction 10.2Essentials of.
Conditional Statements.  Quiz  Hand in your jQuery exercises from last lecture  They don't have to be 100% perfect to get full credit  They do have.
COMP403 Web Design JAVA SCRİPTS Tolgay KARANFİLLER.
HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.
CSC 405: Web Application Engineering II Course Preliminaries Course Objectives Course Objectives Students’ Learning Outcomes Students’ Learning Outcomes.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
CS 1150 – Lab #12B – Databases TA – Sanjaya Wijeratne – Web Page -
1 CS 4396 Computer Networks Lab General Info. 2 Goal: This course aims at helping students get more insight into how the Internet works and gain hands.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Course Information CSE 2031 Fall Instructor U. T. Nguyen /new-yen/ Office: CSEB Office hours:  Tuesday,
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
CS 1150 – Lab #4 – Logic Circuits TA – Sanjaya Wijeratne – Web Page -
BIT116: Scripting Lecture 05
CHAPTER 10 JAVA SCRIPT.
CS 1150 – Lab #8 – Using Algorithms for Painting
Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
JavaScript: Introduction to Scripting
CS105 Introduction to Computer Concepts
JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Chapter 7 - JavaScript: Introduction to Scripting
Javascript Chapter 19 and 20 5/3/2019.
Web Programming– UFCFB Lecture 13
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
Chapter 7 - JavaScript: Introduction to Scripting
Presentation transcript:

CS 1150 – JavaScript Programming Lab TA – Sanjaya Wijeratne – Web Page -

TA Labs, Office Hours Laboratory Polices Lab Hours 2:30 PM - 4:20 PM, Monday at Room Oelman Hall TA Office Hours 4:45 PM - 5:45 PM, Monday at Room Russ Engineer Center By appointment – Please to Refer to CS 1150 Course Syllabus for Class and Laboratory Policies Zero tolerance policy for Academic Misconduct – All parties will get 0% marks CS Lab 8 – JavaScript Programming Lab 2

JavaScript Programming Lab Overview Learn how to write Output Statements, use Message Boxes and Variables Gain an understanding of Conditional Statements and Loops Complete Part 1, 2, 3, 4 and 5 (Write All Programs and Answer All Questions) Lab Due Date - Mar 24, :55 AM 3 CS Lab 8 – JavaScript Programming Lab

How to Submit JavaScript Programming Lab Use Pilot Page for this Weeks’s Submission Go to Pilot Course Page and Use Dropbox Submission Link to upload your files I should be able to run your programs. Please submit all your html files and answers to pilot Use the checklist to make sure you have submitted all files 4 CS Lab 8 – JavaScript Programming Lab

What is JavaScript 5 Client-side Scripting Language Used to create Dynamic Web Pages Three ways to write JavaScript Code In HTML Header, within Tags In HTML Body, within Tags In Separate.JS file, within Tags CS Lab 8 – JavaScript Programming Lab

Writing Your First JavaScript Code 6 document.write("Hello World"); alert("Hello World"); HTML Code HTML Header Code SCRIPT Tags HTML Body Writes in to HTML File Writes in to a Message Box CS Lab 8 – JavaScript Programming Lab

Helper HTML Code 7 Use a new copy of this whenever you need it CS Lab 8 – JavaScript Programming Lab

Part 2 Help 8 Input you read through prompt boxes are Strings To perform arithmetic operations on numbers you read through prompt boxes, you need to first convert them to proper data types. var x = 1 – Define variable x and sets its value to 1 x = parseInt(x) – Converts the value stored in variable x to an Integer and stores it in variable x. CS Lab 8 – JavaScript Programming Lab

Part 3 Help 9 var x = 1; if (x== 1) { document.write("x is " + x); } else { document.write("x is not 1"); } Simple conditional (if- else) statement written in JavaScript Run this to see how a conditional (if-else) statement works in JavaScript CS Lab 8 – JavaScript Programming Lab

Part 4 – Speed Conversion Program 10 You need to use if-else statements. Based on the input you receive from the user (‘M’ or ‘K’), decide which formula to execute to calculate the new speed. You need minimum of three variables Look at the screenshots given to have an idea about the inputs and the output CS Lab 8 – JavaScript Programming Lab

Part 4 – Rock Paper Scissors Game 11 You need to use nested if-else statements. Look at the screenshots given to have an idea about the inputs and the output Think what are the inputs you want to store in variables Think about all possible outcomes that you may run into when playing this game (Draw, Player 1 Wins, Player 2 Wins) CS Lab 8 – JavaScript Programming Lab

Part 4 – Rock Paper Scissors Game Cont. 12 The game has three outcomes. They are; Game ends in a draw (if both players input the same letter) Player 1 can win (There are 3 ways player one can win – Check what are they) Player 2 can win (If the game is not a tie (draw) nor won by Player 1, Player 2 wins) Try to implement this logic using nested if-else statements CS Lab 8 – JavaScript Programming Lab

Part 5 Help 13 for (var i=0; i<2; i++) { alert("Hello " + i); } Simple for loop written in JavaScript Run this to see how a for loop works in JavaScript CS Lab 8 – JavaScript Programming Lab

Part 5 Help Cont. 14 var counter = 0; document.write("Starting Loop" + " "); while (counter < 5) { document.write("Current Count : " + counter + " "); counter++; } document.write("Loop stopped"); Copy the code shown Identify what is; Loop initialization step Looping condition (test) Loop update statement Now replace the while loop with a for loop CS Lab 8 – JavaScript Programming Lab

Part 5 – Rock Paper Scissors Tournament 15 You need to write a loop that runs 5 times You need to have variables to store how many games won by Player 1 and Player 2 when they play this game for five times After the program is run for five times, check who has most number of wins CS Lab 8 – JavaScript Programming Lab

Additional Help 16 Look at JavaScript Presentations Slides discussed in class by Mr. Chris Fickert Read the JavaScript Book CS Lab 8 – JavaScript Programming Lab

Questions ? If you have questions, please raise your hand, Colin or I will come to help you 17 CS Lab 8 – JavaScript Programming Lab