CS1046 Lab 4. Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to:

Size: px
Start display at page:

Download "CS1046 Lab 4. Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to:"

Transcription

1 CS1046 Lab 4 Timing: This lab should take you 85 to 130 minutes. Objectives: By the end of this lab you should be able to: Define the terms: function, calling and user-defined function and predefined function Call/use a predefined function Identify the parts of a function body, name, parameters, return value Trace a given user-defined function to determine what it will do/return Write/create/declare a user-defined function Call a user-defined function Determine the scope of a variable Use the predefined function Random to return a random number between two given values. Exercise 1 Some basic concepts: Functions, user-defined and predefined When baking a pie, we can divide our process into 4 steps: 1. Make the crust 2. Make the filling 3. Fill the crust with the filling and put the top on the pie 4. Bake the pie What we are doing is called Divide and Conquer. We are breaking a really big task (making a pie), into smaller, easier-to-accomplish tasks. Programmers do the same thing, they break a large program into small tasks (programmers call the tasks functions) and then put those functions together to create a working program. Now imagine that rather than having to make a fresh crust each time for pie, instead, you make it ahead of time and put it in the freeze for everyone who bakes to use (when they need some crust, they just pull some out of the freeze). Programmers do this also. One programmer will make a function (called a predefined function) that does some sort of task (like change the background colour of an object, that could be a predefined task) and share it with other programmers so that they don t have to waste their time writing the code again, they can just use the predefined function. Also when programming, there are tasks that a programmer knows will be needed to be done over and over again, such as writing to the webpage or getting the current date and time. Why should we force the programmer to write the statements for these actions over and over again when we could just write the required group of statements once and assign that group of statements a name, then we would call that name whenever we needed to perform the action. This is what a function is: a named group of statements or actions. For example, writing to the webpage, consists of a group of statements stored as 1

2 a function called write(). Thus, write(), is a function. Behind the scenes it is made up of many statements, but all we have to do when we want to write to the document is call the function write() as follows: document.write( hello world ); Calling a function means making the function perform (do something). In previous labs, you have used a few JavaScript functions such as getelementbyid(). In this lab, we will delve deeper into the use of functions. 1. Using the Chrome browser, go to this webpage: Right click and view the source for this page. 2. Create a new folder called lab4. Open Notepad and then save the file (in the lab4 folder) as yourwesternuseridlab4ex1a.html (eg. jsmith2lab4ex1a.html). It is important to save the file as an.html and not.txt file. Consult Lab 1 Exercise 5 if you have trouble. 3. Using the Chrome browser, go to this webpage: and copy the stylesheet. Do this by using Notepad to create a new file in your lab4 folder, paste the css code in it and give this new file the name: lab4ex1.css 4. View the source for the.html file and find the tags that create the button. We are going to call the write function when the user clicks on the button by changing the <button> tag to this: <button onclick="document.write('hello World');" > Notice that the string, Hello World, is surrounded by single quotes. This is very important because we have already used the double quotes around the function call document.write(..); and if we were to use double quotes again the interpreter get mixed up, it won t know how to pair up the double quotes. That is why, in this case, you have to put the single quotes inside the double quotes. This helps the interpreter figure out the pairing. 5. Reload your webpage and click on the button and make sure that it writes Hello World to the page. You have just called a function. Congratulations. Now let us try calling some other functions now. Change: <button onclick="document.write('hello World');" > to <button onclick="alert ('Hello World');" > and reload your page and observe what the alert function does. 6. Now try using the open function (it opens a new tab in your browser window) as follows: <button onclick="window.open(' > 2

3 7. Reload the webpage and see what happens. JavaScript has a lot of ready-made (ready-to-use) functions that can perform a variety of tasks such as the three examples we have used so far write(), alert() and open(). These functions were each already set up to execute a specific task, and because of this, they are each what we call a predefined function. This means that some other programmer has created them for other programmers to use. When you use a predefined function it has two main parts depicted below: The function name, in this case: alert The function s parameters, in this case: one string, enclosed by quotes: Hello World alert( Hello World ); Just like humans are called by their name, a function is also called by its name. It is then always followed by an opening parenthesis and then sometimes by parameter(s) and then by a closing parenthesis. Parameters are extra pieces of information that you can pass into the function. Some functions need parameters, while others do not. Some functions may need more than 1 parameter, in that case, you separate the parameters by commas. For example, you might have a function called listcolors, and the call could be like this: listcolors( red, green, blue ); Sometimes the parameters are strings, like above, sometimes they are numbers, so you could have a function called addthemup and you could call this function like this: addthemup(45,67); 8. There are some functions that belong to objects and to call them we use a. (dot). For example, the write() function is a method/function of the document object. The open() function is a method/function of the window object. However, the alert() function doesn t belong to an object so we can just call it without a. (dot) in front of it. 9. In certain situations, it may be necessary to design our own functions because we cannot find a function that does exactly what we want. When we make up our own function, we have to first build it before we call it. This is similar to declaring variables before we use them. Every userdefined function must have a declaration. Here is the declaration for a sample user-defined function: function listcolors(col1, col2, col3) { document.write( <h2> My Favourite Colors</h2> ): document.write( <ul> ); document.write( <li> + col1 + </li> ); document.write( <li> + col2 + </li> ); document.write( <li> + col3+ </li> ); document.write( </ul> ); 3

4 Notice that when you design your own functions, you need to list the parameters as variables (the formal parameters). When you call your function, you will put values that will be passed into the parameter variables (the actual parameters). Thus, if the first line when we design our function is: function listcolors(col1,col2, col3) { Notice that col1, col2 and col3 are variables (3 formal parameters). When we call our function as follows: listcolors( blue, green, purple ); (here blue, green and purple are the 3 actual parameters) The values go into the corresponding variables, thus blue gets stored in col1, green gets stored in col2 and purple gets stored in col3. An alternative way to do this would be: var x, y, z; x= blue ; y= green ; z= purple ; listcolors(x,y,z); (here x, y and z are the 3 actual parameters) 10. Let s try building our own user-defined function. In Notepad, open a new file called functionbuilding.js (make sure it is in your lab4 folder) 11. In this new file, insert the following code: function listcolors(col1, col2, col3) { document.write("<h2> My Favourite Colors</h2>"); document.write("<ul>"); document.write("<li>" + col1 + "</li>"); document.write("<li>" + col2 + "</li>"); document.write("<li>" + col3+ "</li>"); document.write("</ul>"); 12. Save the.js file and go to your.html file and insert the following line just above the </head> tag: <script src="functionbuilding.js"></script> 13. Then change the <button> tag so that instead of calling window.open( ), it calls this function you just built whenever the button is clicked. Notice that the above function needs 3 actual parameters to go into the 3 formal parameters that are variables: col1, col2, and col3. So your function call should include your 3 favourite colours, for example: listcolors( Red, Orange, Yellow ); 14. Save your.html file and reload it and make sure it works. If it is not functioning properly, remember you can check the syntax of your code in Google Chrome by showing the Java Console (ctrl-shift-j), then click on the Sources tab, then click on your.js file. Make sure there are no syntax errors. 4

5 15. Let s review the parts of a function when creating (defining) a user-defined function: The function name, in this case: listcolors The opening and closing parentheses that indicate the start and end of the required parameters function listcolors(col1, col2, col3) { document.write("<h2> My Favourite Colors</h2>"); document.write("<ul>"); document.write("<li>" + col1 + "</li>"); document.write("<li>" + col2 + "</li>"); document.write("<li>" + col3+ "</li>"); document.write("</ul>"); The parameter list, variables, separated by commas The opening and closing curly brackets that indicate the start and end of the body of the statements to be performed by the function Congratulations, you now can: The body of the function, i.e the statements that make it do the require task Define the terms: predefined function, user-defined function Identify the following parts of a function: its name and its parameters Call one of the following predefined functions write(), alert() and open(); Create a user-defined function Call a user-defined function 5

6 Exercise 2 Practice writing functions, passing parameters and calling functions 1. We are going to write some functions that calculate the area and perimeter for a rectangle. Using the Chrome browser, go to this webpage: Right click and view the source for this page, copy the source into the lab4 folder with the name yourwesternuseridlab4ex2a.html (eg. jsmith2lab4ex2a.html). 2. Using the Chrome browser, go to this webpage: and copy that code into your lab4 folder, using Notepad to create a new file, paste the css code in and give this new file the name: lab4ex2.css 3. View the source for your HTML file. Change the <h1> element at the top so that instead of saying Calculations Galore, it says YourFirstName s Calculations Galore (e.g. Homer s Calculations Galore) 4. Change the <button> tag so that it calls the function "alert('hello world');" when the user clicks on the button 5. Reload the HTML page and make sure that when you click on the button, it pops up the alert "hello world". 6. Now, in Notepad, open a new file and save it to your lab4 folder as shapecalculations.js 7. In your.html file add the <script> tags just above the </head> tag and make sure that it points to the script file called shapecalculations.js 8. In this file we will create a function that calculates the area of a rectangle, given its width and height. Notice that we have to give this function variables (this is called passing the variables) that hold the width and height, thus width and height will be the two formal parameters. We will call the function calcarea, thus the first line of your function should be: function calcarea (width, height) { type this into your new file (shapecalculations.js) 9. Next, we will declare (i.e., create) a temporary variable to hold the area. You should always indent functions a little bit, so now our function will look like this: function calcarea (width, height) { var area; 10. Next, we will calculate the area and store the value in the variable (again remember to indent your code within the function). Now you should have: function calcarea(width, height) { var area; area = width * height; Notice that the variable area is declared INSIDE the function. This means that only this function can use the variable area. It is called a local variable. We say it only has scope within the function, this means we can only give it a value or access its value in between the curly braces that indicate the start and end of this function. Another type of variable, a global variable, can be used outside or inside of this function, but not local variables. We will discuss global and local variables later. 6

7 11. When you write a function and you expect it to provide a final answer, the answer/response is called the return value. So now we are going to return back our answer from the function to wherever it was called from. This is called returning the value. Now your function will look like this: function calcarea(width, height) { var area; area = width * height; return area; 12. The last thing we need to do when declaring this function is indicate the end of the function with a closing curly brace. Thus our whole function looks like this: function calcarea(width, height) { var area; area = width * height; return area; 13. Save your.js file. 14. Now we need to make sure our new function, calcarea, works properly. To do so, we will test it in the HTML file by calling it. In the HTML function, change the <button> tag so that it says: <button onclick="alert(calcarea(2,3));"> and reload your page and click on the button. Remember to check the JavaScript console if it does not work (In Chrome, click on the setting button: > More Tools>Developers Tools) and see if you can identify errors that exist. 15. When you clicked on the button, it should have popped up the answer 6, this is because we passed into the function the width of 2 and height of 3(as parameters) calcarea(2,3). However, what we really want to pass into the function are the values that are typed into the text boxes. Let s change the HTML button tag to this : <button onclick="alert(calcarea(shapewidth.value,shapeheight.value));"> 16. Save the HTML file, type numbers in the textboxes and observe the changes when you click the button. 17. To beautify our webpage we could put our answer somewhere other than in a popup box. So right under the </button></p> tags in the HTML, add the line: <p>the answer is: <label id="answer"></label></p> Notice we gave used a <label> tag (<label> html tags just display a result) and we gave it the id of answer. This is where we are going to display the results on our page by referring to the element with the id of answer in the next steps. 7

8 18. Save your HTML file. Reload the page and make sure the answer paragraph is there. Now we have a little label called answer where we can display our answer. But now we need to change our function so that rather than returning the area to the alert popup box, it will instead put the area in the paragraph section. We will use the predefined function: getelementbyid to return that paragraph element and store that element in a variable, then we will assign the area answer to that variable. Go back into your.js file and change the function so that it now looks like this (new lines are red and remove the return line): function calcarea(width, height) { var area; var answerarea; area = width * height; answerarea=document.getelementbyid("answer"); answerarea.innerhtml=area; The innerhtml property sets everything in-between the tags for the answerarea to whatever value you give it. In this case we are giving it the area value we just calculated. Save your.js file 19. Go back to your HTML file and make one more change. We no longer need to call the alert function to display our answer, the way we have rewritten our code, it should just show up in the answer area. So change the <button> label as follows: <button onclick="calcarea(shapewidth.value,shapeheight.value);"> 20. Save the HTML file, reload the page and make sure it works. 21. Now create another button to calculate the perimeter of a rectangle. Put it right under the first Calculate Area button. Your HTML code should look like this (new line is red): <p><button onclick="calcarea(shapewidth.value,shapeheight.value);">calculate Area</button></p> <p><button>calculate Perimeter</button></p> 22. Now go back to your.js file and underneath the calcarea function (AFTER the closing curly brace), create another function called calcperi. This function should calculate the perimeter of a rectangle given its width and height (make them parameters again). NOTE: if you use the formula: peri = width+width+height+height; rather than the formula: peri=(1*width)+(1*width)+(1*height)+(1*height); you will get an unexpected result. See if you can figure out what it is doing. (Hint: thinks of Strings vs Numbers, multiplying a string by a number such as 1 is a little trick to turn it into a number.). Also, display the answer (peri) in the answer area you created. 23. Go back to your HTML file and change the onclick for the second button so that it calls the calcperi function. Make sure the perimeter is be displayed in the same answer paragraph location where you displayed the area of the rectangle. Make sure your code works by saving and refreshing and rerunning your code. 8

9 Just in case you are having problems (BUT TRY IT YOURSELF BEFORE LOOKING AT THE CODE IN BOX BELOW), your code should look similar to this: //calculate the area of a rectangle given its width and height function calcarea(width, height) { var area; var answerarea; area = width * height; answerarea=document.getelementbyid("answer"); answerarea.innerhtml=area; //calculate the perimeter of a rectangle given its width and height function calcperi(width, height) { var peri; var answerarea; peri = (width *2) + (height*2); answerarea=document.getelementbyid("answer"); answerarea.innerhtml=peri; Congratulations, you now can: Define the terms: local variable, return value Call the function/method getelementbyid() to retrieve a webpage element Pass values from textboxes into a function as parameters Write/declare a user-defined function Call a user-defined function Use the JavaScript Console in the browser to find mistakes (debug your code) Force a string into a number 9

10 Exercise 3 Generating Random Numbers 1. There are many times when writing computer programs that we will need a random number. For example, if you were going to have a Guess a number game, you could say to your user Pick a number between 1 and 10 and then in your code you might have: var answer; answer = 7; The first time the user plays the game he/she might not guess 7 but after playing your game just once, the user would already know the number. Therefore, it would be better if you changed the number each time the game is played. In JavaScript, it would be better if you could instead, do something like this: var answer; answer = randomnumber(1, 10); Card games on computers, like FreeCell and Solitaire, generate random cards so that it looks like the deck was shuffled, for example, the programmer might have something like: var suit; var number; suit = randomnumber(1,4); //picks a number from 1 to 4 where 1=clubs, 2=spades, etc.. number = randomnumber(1,13); //picks number from 1 to 13, where 10=10, 11=Jack, etc. Thus, if suit was 1 and number was 12, the card shown would be the Queen of Clubs. Every programming language has a predefined random number generating function. In this exercise, we will learn how to use JavaScript s random number generating predefined function. (It doesn t look exactly like the code written above, that was just to illustrate the point). 2. Using the Chrome browser, go to this webpage: Right click and view the source for this page, save the source into the lab4 folder with the name yourwesternuseridlab4ex3a.html (eg. jsmith2lab4ex3a.html). 3. Look at the HTML tags and notice the <script> tag refers to the file called randomnumbers.js. Open a new file in Notepad and save it as randomnumbers.js in your lab4 folder. In randomnumbers.js declare a function called getrandomnumber. This function should have 2 parameters: low and high. At this point, it should look like this: function getrandomnumber(low, high) { 4. Next, we will add code between the curly brackets to get the random number. Let us try using the JavaScript random number generator Math.random() to see what it returns. Update your function so that it looks like this: function getrandomnumber(low, high) { var rannum; rannum = Math.random(); alert(rannum); 10

11 5. Notice that Math.random() is a predefined function that has NO parameters. Remember that some functions have no parameters. This function generates a real number from 0, up to but not including 1. Therefore, we might get the number , or we might get the number 0.524, or we might get the number Save your.js file then return to your.html file, and change the <button> so that your getrandomnumber function is called when the user clicks on the button. At this point our low variable and high variable are just place holders with no functionality so you can set them to any value. Your HTML might look like this: <button onclick="getrandomnumber(1,10);"> 7. Save your HTML file and reload the page, click on the button a few times and notice that the number that appears is between 0 and 1. This real number has lots of decimals which makes it confusing. To change this real number to an integer we are going to use another Math function, Math.floor(). This function truncates your number to an integer, so if you put Math.floor( ), it would return 3. Our problem is that our number is always 0.????, so if we used Math.floor(Math.random()), we would always get 0. To get around this issue we will multiply Math.random() by 10, which will give us a real number between 0 and 9, next we will apply Math.floor to the result to make it an integer between 0 and 9 and finally we will add 1 to that number so that our final value is between 1 and 10. So, in your.js file, change the line rannum=math.random(); to rannum=math.random()*10 ; //generates a random number between and rannum = Math.floor (rannum); //turn real number into an integer by dropping the decimals rannum=rannum + 1; //make the random number go from 1 to 10 rather than 0 to 9 8. Save your.js file and try pressing your button again a few times to make sure you are getting random numbers between 1 and Now we need to change the code so that it generates a random number between our low value and our high value (e.g. if low was 3 and high was 5, then we would want one of the numbers 3 or 4 or 5 (thus, we want THREE random numbers which is 5-3 PLUS 1, so we want high-low +1)). First, change your variables from strings to numbers and then update the rannum assignment statement so it uses our values as show below. low=low*1; //change from string to number high=high*1;//change from string to number rannum= Math.random()*(high-low+1); //figure out how many numbers to get Function should look like this now: 11

12 10. Save your.js file and then go to your HTML file and change the parameters that you are passing to the function call to be the textbox values like in the previous exercise. Notice that the ids are different for the low and high values from the previous exercise. 11. Save your HTML file and make sure it works. Press the button a few times. Notice that we are getting real numbers again not integers, remember we need to use Math.floor() to make it an integer, so now add this line in your.js file BEFORE the alert line: rannum=math.floor(rannum); //turn into integer 12. Save your.js file and test your code again. Notice we are not quite there yet. Now it generates random integers but it doesn t start at our lower boundary. We need to add the lower boundary to move it from starting at 0 to starting at that boundary. Go back to your.js file and add this line before the alert line rannum=rannum + low; //move the lower boundary up from 0 to the smallest number Your code should now look like this: 13. Save your.js file and test your html code again (reload it and press the button). Press the button a few times to make sure you are getting the correct numbers (E.g. try putting the boundaries as 3 and 5 and make sure you just get the numbers 3 OR 4 OR 5, then put the boundaries as 8 and 11 and make sure you get 8 or 9 or 10 or 11 ). 14. Now change your code so that it displays on the page (below the button) rather than popping up in the alert window. Congratulations, you now can: Use Math.random() to get a random value. Use Math.floor() to change a real number to an integer, to truncate the real number. Perform multi-step mathematics. 12

13 Exercise 4 Testing local variables and global variables and scope rules 1. This time you are just going to watch what happens with variables, so you don t need to copy this file to your lab4 folder, you can just open it here: 2. Then open the file: and look at the alerts, which are OUTSIDE of the functions. Look at the global variables at the top. We can use them anywhere, but the local variables that are declared in the functions can only be used in their associated function. 3. Click on the buttons, then look at the values on the bottom of the page and try to figure out what will be in each of the variables. Trace them on paper (draw a box for each variable and show what is in each variable). Walk step by step through each line for each function, trying to determine how each variable will change. Scoping, global variables and local variables are some of the hardest concepts for new programmers to master. If you don t quite understand this code, see your instructor to review this with you. Congratulations, you now can: a. Determine when a local variable will lose its scope b. Trace a function that uses global and local variables HAND THIS WORK INTO OWL IN ORDER TO GET YOUR LAB MARK. 1. Go into owl and for Lab 4, submit the file called yourwesternuseridlab4ex2a.html AND shapecalculations.js so that we can check that your code is working properly. 13

Exercise 1 Using Boolean variables, incorporating JavaScript code into your HTML webpage and using the document object

Exercise 1 Using Boolean variables, incorporating JavaScript code into your HTML webpage and using the document object CS1046 Lab 5 Timing: This lab should take you approximately 2 hours. Objectives: By the end of this lab you should be able to: Recognize a Boolean variable and identify the two values it can take Calculate

More information

A340 Laboratory Session #5

A340 Laboratory Session #5 A340 Laboratory Session #5 LAB GOALS Creating multiplication table using JavaScript Creating Random numbers using the Math object Using your text editor (Notepad++ / TextWrangler) create a web page similar

More information

CMPT 100 : INTRODUCTION TO

CMPT 100 : INTRODUCTION TO CMPT 100 : INTRODUCTION TO COMPUTING TUTORIAL #5 : JAVASCRIPT 2 GUESSING GAME 1 By Wendy Sharpe BEFORE WE GET STARTED... If you have not been to the first tutorial introduction JavaScript then you must

More information

JavaScript: Tutorial 5

JavaScript: Tutorial 5 JavaScript: Tutorial 5 In tutorial 1 you learned: 1. How to add javascript to your html code 2. How to write a function in js 3. How to call a function in your html using onclick() and buttons 4. How to

More information

Lab 8 CSE 3,Fall 2017

Lab 8 CSE 3,Fall 2017 Lab 8 CSE 3,Fall 2017 In this lab we are going to take what we have learned about both HTML and JavaScript and use it to create an attractive interactive page. Today we will create a web page that lets

More information

Lesson 1: Writing Your First JavaScript

Lesson 1: Writing Your First JavaScript JavaScript 101 1-1 Lesson 1: Writing Your First JavaScript OBJECTIVES: In this lesson you will be taught how to Use the tag Insert JavaScript code in a Web page Hide your JavaScript

More information

Working with JavaScript

Working with JavaScript Working with JavaScript Creating a Programmable Web Page for North Pole Novelties 1 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page 2 Objectives

More information

(Refer Slide Time: 01:40)

(Refer Slide Time: 01:40) Internet Technology Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture No #25 Javascript Part I Today will be talking about a language

More information

ORB Education Quality Teaching Resources

ORB Education Quality Teaching Resources JavaScript is one of the programming languages that make things happen in a web page. It is a fantastic way for students to get to grips with some of the basics of programming, whilst opening the door

More information

CSS worksheet. JMC 105 Drake University

CSS worksheet. JMC 105 Drake University CSS worksheet JMC 105 Drake University 1. Download the css-site.zip file from the class blog and expand the files. You ll notice that you have an images folder with three images inside and an index.html

More information

Enhancing Web Pages with JavaScript

Enhancing Web Pages with JavaScript Enhancing Web Pages with JavaScript Introduction In this Tour we will cover: o The basic concepts of programming o How those concepts are translated into JavaScript o How JavaScript can be used to enhance

More information

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

More information

HTML/CSS Lesson Plans

HTML/CSS Lesson Plans HTML/CSS Lesson Plans Course Outline 8 lessons x 1 hour Class size: 15-25 students Age: 10-12 years Requirements Computer for each student (or pair) and a classroom projector Pencil and paper Internet

More information

1 Getting started with Processing

1 Getting started with Processing cis3.5, spring 2009, lab II.1 / prof sklar. 1 Getting started with Processing Processing is a sketch programming tool designed for use by non-technical people (e.g., artists, designers, musicians). For

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28

Programming Lab 1 (JS Hwk 3) Due Thursday, April 28 Programming Lab 1 (JS Hwk 3) Due Thursday, April 28 Lab You may work with partners for these problems. Make sure you put BOTH names on the problems. Create a folder named JSLab3, and place all of the web

More information

Lab # 2. For today s lab:

Lab # 2. For today s lab: 1 ITI 1120 Lab # 2 Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot 1 For today s lab: Go the course webpage Follow the links to the lab notes for Lab 2. Save all the java programs you

More information

UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? editor editor Q.2: What do you understand by a web browser?

UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? editor editor Q.2: What do you understand by a web browser? UNIT 3 SECTION 1 Answer the following questions Q.1: What is an editor? A 1: A text editor is a program that helps you write plain text (without any formatting) and save it to a file. A good example is

More information

Functions, Randomness and Libraries

Functions, Randomness and Libraries Functions, Randomness and Libraries 1 Predefined Functions recall: in mathematics, a function is a mapping from inputs to a single output e.g., the absolute value function: -5 5, 17.3 17.3 in JavaScript,

More information

Shorthand for values: variables

Shorthand for values: variables Chapter 2 Shorthand for values: variables 2.1 Defining a variable You ve typed a lot of expressions into the computer involving pictures, but every time you need a different picture, you ve needed to find

More information

Project 2: After Image

Project 2: After Image Project 2: After Image FIT100 Winter 2007 Have you ever stared at an image and noticed that when it disappeared, a shadow of the image was still briefly visible. This is called an after image, and we experiment

More information

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple

More information

CS Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB!

CS Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB! CS 1033 Multimedia and Communications REMEMBER TO BRING YOUR MEMORY STICK TO EVERY LAB! Lab 06: Introduction to KompoZer (Website Design - Part 3 of 3) Lab 6 Tutorial 1 In this lab we are going to learn

More information

Lesson 1 HTML Basics. The Creative Computer Lab. creativecomputerlab.com

Lesson 1 HTML Basics. The Creative Computer Lab. creativecomputerlab.com Lesson 1 HTML Basics The Creative Computer Lab creativecomputerlab.com What we are going to do today Become familiar with web development tools Build our own web page from scratch! Learn where to find

More information

Variables and Typing

Variables and Typing Variables and Typing Christopher M. Harden Contents 1 The basic workflow 2 2 Variables 3 2.1 Declaring a variable........................ 3 2.2 Assigning to a variable...................... 4 2.3 Other

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Beginning HTML. The Nuts and Bolts of building Web pages.

Beginning HTML. The Nuts and Bolts of building Web pages. Beginning HTML The Nuts and Bolts of building Web pages. Overview Today we will cover: 1. what is HTML and what is it not? Building a simple webpage Getting that online. What is HTML? The language of the

More information

introjs.notebook March 02, 2014

introjs.notebook March 02, 2014 1 document.write() uses the write method to write on the document. It writes the literal Hello World! which is enclosed in quotes since it is a literal and then enclosed in the () of the write method.

More information

CSCU9B2 Practical 1: Introduction to HTML 5

CSCU9B2 Practical 1: Introduction to HTML 5 CSCU9B2 Practical 1: Introduction to HTML 5 Aim: To learn the basics of creating web pages with HTML5. Please register your practical attendance: Go to the GROUPS\CSCU9B2 folder in your Computer folder

More information

Java Programming Fundamentals - Day Instructor: Jason Yoon Website:

Java Programming Fundamentals - Day Instructor: Jason Yoon Website: Java Programming Fundamentals - Day 1 07.09.2016 Instructor: Jason Yoon Website: http://mryoon.weebly.com Quick Advice Before We Get Started Java is not the same as javascript! Don t get them confused

More information

Introduction to Programming with JES

Introduction to Programming with JES Introduction to Programming with JES Titus Winters & Josef Spjut October 6, 2005 1 Introduction First off, welcome to UCR, and congratulations on becoming a Computer Engineering major. Excellent choice.

More information

COMS 469: Interactive Media II

COMS 469: Interactive Media II COMS 469: Interactive Media II Agenda Review Data Types & Variables Decisions, Loops, and Functions Review gunkelweb.com/coms469 Review Basic Terminology Computer Languages Interpreted vs. Compiled Client

More information

EVENT-DRIVEN PROGRAMMING

EVENT-DRIVEN PROGRAMMING LESSON 13 EVENT-DRIVEN PROGRAMMING This lesson shows how to package JavaScript code into self-defined functions. The code in a function is not executed until the function is called upon by name. This is

More information

Section 1. How to use Brackets to develop JavaScript applications

Section 1. How to use Brackets to develop JavaScript applications Section 1 How to use Brackets to develop JavaScript applications This document is a free download from Murach books. It is especially designed for people who are using Murach s JavaScript and jquery, because

More information

Looking at the Internet with Google Chrome & Firefox. Scoville Memorial Library Claudia Cayne - September, 2010

Looking at the Internet with Google Chrome & Firefox. Scoville Memorial Library Claudia Cayne - September, 2010 Looking at the Internet with Google Chrome & Firefox Scoville Memorial Library Claudia Cayne - ccayne@biblio.org September, 2010 Google Chrome & Firefox are web browsers - the decoder you need to view

More information

EXERCISE: Introduction to client side JavaScript

EXERCISE: Introduction to client side JavaScript EXERCISE: Introduction to client side JavaScript Barend Köbben Version 1.3 March 23, 2015 Contents 1 Dynamic HTML and scripting 3 2 The scripting language JavaScript 3 3 Using Javascript in a web page

More information

Problem 1: Textbook Questions [4 marks]

Problem 1: Textbook Questions [4 marks] Problem 1: Textbook Questions [4 marks] Answer the following questions from Fluency with Information Technology. Chapter 3, Short Answer #8: A company that supplies connections to the Internet is called

More information

Princess Nourah bint Abdulrahman University. Computer Sciences Department

Princess Nourah bint Abdulrahman University. Computer Sciences Department Princess Nourah bint Abdulrahman University 1 And use http://www.w3schools.com/ JavaScript Objectives Introduction to JavaScript Objects Data Variables Operators Types Functions Events 4 Why Study JavaScript?

More information

var num1 = prompt("enter a number between 1 and 12","1"); var promptstring = "What is " + num1 + " times 3?"; var num2 = prompt(promptstring);

var num1 = prompt(enter a number between 1 and 12,1); var promptstring = What is  + num1 +  times 3?; var num2 = prompt(promptstring); JavaScript Week 2: Last week we learned about the document, which is your html page, and document.write, which is one way in which javascript allows you to write html code to your web page. We also learned

More information

ORB Education Quality Teaching Resources

ORB Education Quality Teaching Resources These basic resources aim to keep things simple and avoid HTML and CSS completely, whilst helping familiarise students with what can be a daunting interface. The final websites will not demonstrate best

More information

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser. Controlled Assessment Task Question 1 - Describe how this HTML code produces the form displayed in the browser. The form s code is displayed in the tags; this creates the object which is the visible

More information

JS Lab 1: (Due Thurs, April 27)

JS Lab 1: (Due Thurs, April 27) JS Lab 1: (Due Thurs, April 27) For this lab, you may work with a partner, or you may work alone. If you choose a partner, this will be your partner for the final project. If you choose to do it with a

More information

BEGINNER PHP Table of Contents

BEGINNER PHP Table of Contents Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing

More information

JavaScript Introduction

JavaScript Introduction JavaScript Introduction What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means

More information

Copyright 2018 MakeUseOf. All Rights Reserved.

Copyright 2018 MakeUseOf. All Rights Reserved. 15 Power User Tips for Tabs in Firefox 57 Quantum Written by Lori Kaufman Published March 2018. Read the original article here: https://www.makeuseof.com/tag/firefox-tabs-tips/ This ebook is the intellectual

More information

Class 3 Page 1. Using DW tools to learn CSS. Intro to Web Design using Dreamweaver (VBUS 010) Instructor: Robert Lee

Class 3 Page 1. Using DW tools to learn CSS. Intro to Web Design using Dreamweaver (VBUS 010) Instructor: Robert Lee Class 3 Page 1 Using DW tools to learn CSS Dreaweaver provides a way for beginners to learn CSS. Here s how: After a page is set up, you might want to style the . Like setting up font-family, or

More information

c122mar413.notebook March 06, 2013

c122mar413.notebook March 06, 2013 These are the programs I am going to cover today. 1 2 Javascript is embedded in HTML. The document.write() will write the literal Hello World! to the web page document. Then the alert() puts out a pop

More information

Website Development Komodo Editor and HTML Intro

Website Development Komodo Editor and HTML Intro Website Development Komodo Editor and HTML Intro Introduction In this Lecture and Tour we will cover: o Use of the editor that will be used for the Website Development and Javascript Programming sections

More information

CS Problem Solving and Object-Oriented Programming

CS Problem Solving and Object-Oriented Programming CS 101 - Problem Solving and Object-Oriented Programming Lab 5 - Draw a Penguin Due: October 28/29 Pre-lab Preparation Before coming to lab, you are expected to have: Read Bruce chapters 1-3 Introduction

More information

Initial Coding Guidelines

Initial Coding Guidelines Initial Coding Guidelines ITK 168 (Lim) This handout specifies coding guidelines for programs in ITK 168. You are expected to follow these guidelines precisely for all lecture programs, and for lab programs.

More information

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from

BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from BEFORE CLASS If you haven t already installed the Firebug extension for Firefox, download it now from http://getfirebug.com. If you don t already have the Firebug extension for Firefox, Safari, or Google

More information

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4 Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML 4.01 Version: 4.01 Transitional Hypertext Markup Language is the coding behind web publishing. In this tutorial, basic knowledge of HTML will be covered

More information

Programming language components

Programming language components Programming language components syntax: grammar rules for defining legal statements what's grammatically legal? how are things built up from smaller things? semantics: what things mean what do they compute?

More information

Lesson 5: Introduction to Events

Lesson 5: Introduction to Events JavaScript 101 5-1 Lesson 5: Introduction to Events OBJECTIVES: In this lesson you will learn about Event driven programming Events and event handlers The onclick event handler for hyperlinks The onclick

More information

EXCEL BASICS: MICROSOFT OFFICE 2010

EXCEL BASICS: MICROSOFT OFFICE 2010 EXCEL BASICS: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes

More information

Lesson 6: Introduction to Functions

Lesson 6: Introduction to Functions JavaScript 101 6-1 Lesson 6: Introduction to Functions OBJECTIVES: In this lesson you will learn about Functions Why functions are useful How to declare a function How to use a function Why functions are

More information

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 11

Manju Muralidharan Priya. CS4PM Web Aesthetics and Development WEEK 11 CS4PM Web Aesthetics and Development WEEK 11 Objective: Understand basics of JScript Outline: a. Basics of JScript Reading: Refer to w3schools websites and use the TRY IT YOURSELF editor and play with

More information

JavaScript Basics. The Big Picture

JavaScript Basics. The Big Picture JavaScript Basics At this point, you should have reached a certain comfort level with typing and running JavaScript code assuming, of course, that someone has already written it for you This handout aims

More information

ASCII Art. Introduction: Python

ASCII Art. Introduction: Python Python 1 ASCII Art All Code Clubs must be registered. Registered clubs appear on the map at codeclub.org.uk - if your club is not on the map then visit jumpto.cc/18cplpy to find out what to do. Introduction:

More information

EXCEL BASICS: MICROSOFT OFFICE 2007

EXCEL BASICS: MICROSOFT OFFICE 2007 EXCEL BASICS: MICROSOFT OFFICE 2007 GETTING STARTED PAGE 02 Prerequisites What You Will Learn USING MICROSOFT EXCEL PAGE 03 Opening Microsoft Excel Microsoft Excel Features Keyboard Review Pointer Shapes

More information

CS1046 Lab 1. <h1> </h1> <h6>this is a level h6 header. Pretty small!</h6> Objectives: By the end of this lab you should be able to:

CS1046 Lab 1. <h1> </h1> <h6>this is a level h6 header. Pretty small!</h6> Objectives: By the end of this lab you should be able to: CS1046 Lab 1 Objectives: By the end of this lab you should be able to: View the html tags for any webpage Given an html file, identify at least 5 tags and explain what they are used for Identify an opening

More information

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners

Getting Started. Excerpted from Hello World! Computer Programming for Kids and Other Beginners Getting Started Excerpted from Hello World! Computer Programming for Kids and Other Beginners EARLY ACCESS EDITION Warren D. Sande and Carter Sande MEAP Release: May 2008 Softbound print: November 2008

More information

Teach Yourself HTML5 & CSS 3: Week 5 Task 13 - Anchors Part 3

Teach Yourself HTML5 & CSS 3: Week 5 Task 13 - Anchors Part 3 http://www.gerrykruyer.com Teach Yourself HTML5 & CSS 3: Week 5 Task 13 - Anchors Part 3 In this task you will continue working on the website you have been working on for the last two weeks. This week

More information

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 10: OCT. 6TH INSTRUCTOR: JIAYIN WANG 1 Notice Assignments Reading Assignment: Chapter 3: Introduction to Parameters and Objects The Class 10 Exercise

More information

[ the academy_of_code] Senior Beginners

[ the academy_of_code] Senior Beginners [ the academy_of_code] Senior Beginners 1 Drawing Circles First step open Processing Open Processing by clicking on the Processing icon (that s the white P on the blue background your teacher will tell

More information

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA 1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared

More information

<script> function yourfirstfunc() { alert("hello World!") } </script>

<script> function yourfirstfunc() { alert(hello World!) } </script> JavaScript: Lesson 1 Terms: HTML: a mark-up language used for web pages (no power) CSS: a system for adding style to web pages css allows developers to choose how to style the html elements in a web page

More information

Computer and Programming: Lab 1

Computer and Programming: Lab 1 01204111 Computer and Programming: Lab 1 Name ID Section Goals To get familiar with Wing IDE and learn common mistakes with programming in Python To practice using Python interactively through Python Shell

More information

CISC 110 Week 3. Expressions, Statements, Programming Style, and Test Review

CISC 110 Week 3. Expressions, Statements, Programming Style, and Test Review CISC 110 Week 3 Expressions, Statements, Programming Style, and Test Review Today Review last week Expressions/Statements Programming Style Reading/writing IO Test review! Trace Statements Purpose is to

More information

Using Dreamweaver CS6

Using Dreamweaver CS6 Using Dreamweaver CS6 4 Creating a Template Now that the main page of our website is complete, we need to create the rest of the pages. Each of them will have a layout that follows the plan shown below.

More information

GoLive will first ask you if your new site will be for one individual or a work group; select for a Single User, and click Next.

GoLive will first ask you if your new site will be for one individual or a work group; select for a Single User, and click Next. Getting Started From the Start menu, located the Adobe folder which should contain the Adobe GoLive 6.0 folder. Inside this folder, click Adobe GoLive 6.0. GoLive will open to its initial project selection

More information

JQuery and Javascript

JQuery and Javascript JQuery and Javascript Javascript - a programming language to perform calculations/ manipulate HTML and CSS/ make a web page interactive JQuery - a javascript framework to help manipulate HTML and CSS JQuery

More information

Task 1. Set up Coursework/Examination Weights

Task 1. Set up Coursework/Examination Weights Lab02 Page 1 of 6 Lab 02 Student Mark Calculation HTML table button textbox JavaScript comments function parameter and argument variable naming Number().toFixed() Introduction In this lab you will create

More information

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9

Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Survey of Math: Excel Spreadsheet Guide (for Excel 2016) Page 1 of 9 Contents 1 Introduction to Using Excel Spreadsheets 2 1.1 A Serious Note About Data Security.................................... 2 1.2

More information

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet. Mr G s Java Jive #2: Yo! Our First Program With this handout you ll write your first program, which we ll call Yo. Programs, Classes, and Objects, Oh My! People regularly refer to Java as a language that

More information

6.170 Laboratory in Software Engineering Java Style Guide. Overview. Descriptive names. Consistent indentation and spacing. Page 1 of 5.

6.170 Laboratory in Software Engineering Java Style Guide. Overview. Descriptive names. Consistent indentation and spacing. Page 1 of 5. Page 1 of 5 6.170 Laboratory in Software Engineering Java Style Guide Contents: Overview Descriptive names Consistent indentation and spacing Informative comments Commenting code TODO comments 6.170 Javadocs

More information

Chapter 17. Fundamental Concepts Expressed in JavaScript

Chapter 17. Fundamental Concepts Expressed in JavaScript Chapter 17 Fundamental Concepts Expressed in JavaScript Learning Objectives Tell the difference between name, value, and variable List three basic data types and the rules for specifying them in a program

More information

Guidelines for doing the short exercises

Guidelines for doing the short exercises 1 Short exercises for Murach s HTML5 and CSS Guidelines for doing the short exercises Do the exercise steps in sequence. That way, you will work from the most important tasks to the least important. Feel

More information

Mobile App:IT. Methods & Classes

Mobile App:IT. Methods & Classes Mobile App:IT Methods & Classes WHAT IS A METHOD? - A method is a set of code which is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method's name. -

More information

Anatomy of a Function. Pick a Name. Parameters. Definition. Chapter 20: Thinking Big: Programming Functions

Anatomy of a Function. Pick a Name. Parameters. Definition. Chapter 20: Thinking Big: Programming Functions Chapter 20: Thinking Big: Programming Functions Fluency with Information Technology Third Edition by Lawrence Snyder Anatomy of a Function Functions are packages for algorithms 3 parts Name Parameters

More information

CMSC 201 Fall 2016 Lab 09 Advanced Debugging

CMSC 201 Fall 2016 Lab 09 Advanced Debugging CMSC 201 Fall 2016 Lab 09 Advanced Debugging Assignment: Lab 09 Advanced Debugging Due Date: During discussion Value: 10 points Part 1: Introduction to Errors Throughout this semester, we have been working

More information

Session 3: JavaScript - Structured Programming

Session 3: JavaScript - Structured Programming INFM 603: Information Technology and Organizational Context Session 3: JavaScript - Structured Programming Jimmy Lin The ischool University of Maryland Thursday, September 25, 2014 Source: Wikipedia Types

More information

Dreamweaver: Web Forms

Dreamweaver: Web Forms Dreamweaver: Web Forms Introduction Web forms allow your users to type information into form fields on a web page and send it to you. Dreamweaver makes it easy to create them. This workshop is a follow-up

More information

Animations involving numbers

Animations involving numbers 136 Chapter 8 Animations involving numbers 8.1 Model and view The examples of Chapter 6 all compute the next picture in the animation from the previous picture. This turns out to be a rather restrictive

More information

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Make a Website A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1 Overview Course outcome: You'll build four simple websites using web

More information

Math Day 2 Programming: How to make computers do math for you

Math Day 2 Programming: How to make computers do math for you Math Day 2 Programming: How to make computers do math for you Matt Coles February 10, 2015 1 Intro to Python (15min) Python is an example of a programming language. There are many programming languages.

More information

HTML 5 and CSS 3, Illustrated Complete. Unit L: Programming Web Pages with JavaScript

HTML 5 and CSS 3, Illustrated Complete. Unit L: Programming Web Pages with JavaScript HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript Objectives Explore the Document Object Model Add content using a script Trigger a script using an event handler Create

More information

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL

TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL TUTORIAL FOR IMPORTING OTTAWA FIRE HYDRANT PARKING VIOLATION DATA INTO MYSQL We have spent the first part of the course learning Excel: importing files, cleaning, sorting, filtering, pivot tables and exporting

More information

Chapter 3 - Simple JavaScript - Programming Basics. Lesson 1 - JavaScript: What is it and what does it look like?

Chapter 3 - Simple JavaScript - Programming Basics. Lesson 1 - JavaScript: What is it and what does it look like? Chapter 3 - Simple JavaScript - Programming Basics Lesson 1 - JavaScript: What is it and what does it look like? PP presentation JavaScript.ppt. Lab 3.1. Lesson 2 - JavaScript Comments, document.write(),

More information

CSC Web Programming. Introduction to JavaScript

CSC Web Programming. Introduction to JavaScript CSC 242 - Web Programming Introduction to JavaScript JavaScript JavaScript is a client-side scripting language the code is executed by the web browser JavaScript is an embedded language it relies on its

More information

JavaScript CS 4640 Programming Languages for Web Applications

JavaScript CS 4640 Programming Languages for Web Applications JavaScript CS 4640 Programming Languages for Web Applications 1 How HTML, CSS, and JS Fit Together {css} javascript() Content layer The HTML gives the page structure and adds semantics Presentation

More information

COMP 110 Project 1 Programming Project Warm-Up Exercise

COMP 110 Project 1 Programming Project Warm-Up Exercise COMP 110 Project 1 Programming Project Warm-Up Exercise Creating Java Source Files Over the semester, several text editors will be suggested for students to try out. Initially, I suggest you use JGrasp,

More information

Unit Notes. ICAWEB411A Produce basic client-side script for dynamic web pages Topic 1 Introduction to JavaScript

Unit Notes. ICAWEB411A Produce basic client-side script for dynamic web pages Topic 1 Introduction to JavaScript Unit Notes ICAWEB411A Produce basic client-side script for dynamic web pages Topic 1 Introduction to JavaScript Copyright, 2013 by TAFE NSW - North Coast Institute Date last saved: 18 September 2013 by

More information

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script What is Java Script? CMPT 165: Java Script Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University November 7, 2011 JavaScript was designed to add interactivity to HTML pages

More information

Installing VS Code. Instructions for the Window OS.

Installing VS Code. Instructions for the Window OS. Installing VS Code Instructions for the Window OS. VS Code is a free text editor created by Microsoft. It is a lightweight version of their commercial product, Visual Studio. It runs on Microsoft Windows,

More information

Adobe Flash CS3 Reference Flash CS3 Application Window

Adobe Flash CS3 Reference Flash CS3 Application Window Adobe Flash CS3 Reference Flash CS3 Application Window When you load up Flash CS3 and choose to create a new Flash document, the application window should look something like the screenshot below. Layers

More information

Access Forms Masterclass 5 Create Dynamic Titles for Your Forms

Access Forms Masterclass 5 Create Dynamic Titles for Your Forms Access Forms Masterclass 5 Create Dynamic Titles for Your Forms Published: 13 September 2018 Author: Martin Green Screenshots: Access 2016, Windows 10 For Access Versions: 2007, 2010, 2013, 2016 Add a

More information

CISC 1600 Lecture 2.4 Introduction to JavaScript

CISC 1600 Lecture 2.4 Introduction to JavaScript CISC 1600 Lecture 2.4 Introduction to JavaScript Topics: Javascript overview The DOM Variables and objects Selection and Repetition Functions A simple animation What is JavaScript? JavaScript is not Java

More information

Midterm Exam. 5. What is the character - (minus) used for in JavaScript? Give as many answers as you can.

Midterm Exam. 5. What is the character - (minus) used for in JavaScript? Give as many answers as you can. First Name Last Name CSCi 90.3 March 23, 2010 Midterm Exam Instructions: For multiple choice questions, circle the letter of the one best choice unless the question explicitly states that it might have

More information

Tutorial 2 Editor Brackets

Tutorial 2 Editor Brackets Tutorial 2 Editor Brackets Goals Create a website showcasing the following techniques - Content switch with Javascript Website - Create a folder on the desktop called tutorial 2 o - Open Brackets o - Open

More information