Join Your Team

Each week, you will be assigned a new team to work with. Find your new team (your TA should have posted your team assignment) and introduce yourself to them!

Lab Assignment

Your TA should have distributed a print-out of the lab assignment. If you did not get one when you came in, you should ask your TA for one.

If you prefer, you can also view the PDF here.

File Download

Click here to download the files you will use for this lab.

Getting Into a Plain Text Editor

One of the most popular, easy-to-use text editors is a free editor called Notepad++. This program is already on the lab computers! You can find it by clicking Start, then All Programs, then Word Processing, and finally Notepad++.

Once Notepad++ is open, you can use File -> Open to open your JavaScript file you have extracted from the ZIP or you can simply drag the file from Windows into Notepad++.

Cheat Sheet

You can view the entire slide set from Wednesday's lecture here, but here is a quick overview of the cheat sheet given at the end of lecture:

Examples of Statements
Statements always end in a semicolon
___________________;
x = x + 1;
var orange = 4;

Examples of Variables
var n;
var a = 0;
a = a + 1;

Examples of a Conditional
if (x < 3)
{
...statements go inside the braces...
}

Examples of Booleans
n < 3
n > 3
n == 3
n != 3

Examples of a Function
function name(p1, p2)
{
...statements go inside the braces...
return ___________________;
}

Something didn't work?

Your JavaScript should work in any browser, but some browsers are designed to be focused on developing a web page as much as they are on viewing a web page. Internet Explorer, the default browser on most systems, does not come with any included debugging tools.

The first thing to try is to try any browser except Internet Explorer. To open your file in that other browser, you should right click the HTML file (cs105-lab2-html.html) and hover over Open with. Once the pop-up menu shows up, choose either Firefox or Chrome. Your computer may look slightly different, but it should look similar to the following image: Open With

If your code does not work with both browsers -- something is wrong! Check to make sure everything is spelled correct, the capitalization of your variables are the same in every place, and that you have declared all of your variables.

Upload Your Work

Once you have completed all three JavaScript functions, you and everyone in your team need to upload your lab to get credit. Upload your solution here! Your JavaScript file will have a file extension of .js, make sure your upload the correct file or you will not get credit. If you make multiple submissions, we will consider your last submission the one we use for grading.

Remember, the TA will randomly grade one of the submissions from your group and your grade will be based on that submissions. You should double check and help out your team members finish up the lab. Once you and all your team members are finished with the lab, you are done — until next week!

CS 105 (Spring 2014): Introduction to Computing