Michelle's Home Page
Michelle Flinchbaugh's Javascript Practice
Helpful Javascript Pages:
Eloquent Javascript
w3schools Java Operators
Lynda.com Practical and Effective Javascript
Javascript Reference
Programs that I've written for the course are below:
Program #1:
- Write a simple Javascript program which will print the sum of 2+2 and display the result in an alert window in the browser.
You will have to create
an HTML page and put your Javascript code within that page, so it executes when the page loads.
- This just defines the variable and does the math: Add1
-
This defines an object for the variables and math: Add2
- This defines the variables, does the math, and converts the variables into string to make the alert say 2+2=4: Add3
-
This also puts 2 + 2 = 4 in the browser window: Add4
-
This counts from 1-11, puts the values in the browser window, then prints the window: Count
-
Eloquent Javascript Exercise 2.2 finds the 2 to the powers 1-10: 2 to the powers 1-10
-
Eloquent Javascript Exercise 2.3 makes a triangle: Pyramid
-
Eloquent Javascript Exercise 2.4 requires rewriting the previous two exercise using a "for" loop: For Loop 2 to the
powers 1-10, For Loop Pyramid
- Eloquent Javascript Exercise 2.5 requires asking a user the answer to 2+2 and telling them if they're right or wrong: 2+2+?
-
Eloquent Javascript Exercise 2.6 requires asking a user the answer to 2+2 and keeps asking until the correct answer is provided:
2+2+?
-
Eloquent Javascript Exercise 3.1 requires creating a function that finds the absolute number of a user provided number. Aspects that make a function
are included as notes to make this a functioning program: Absolute Value
-
Eloquent Javascript Exercise 3.2 requires creating a function that finds out if one number is greater than another number (this algorithm only
works with single-digit nubmers): Greater than Function
-
Eloquent Javascript Exercise 4.1 requires creating a function that finds the absolute value of a number:
Absolute Value Function
-
Eloquent Javascript Exercise 4.2 requires creating a function that gives a range of numbers given the high and low value:
the numbers in a range
-
Eloquent Javascript Exercise 4.3 requires demonstrating that the split and join properties aren't exact inverses. The program joins an array, then
joins it and splits it, getting a different result than the original array here: Splitting and joining demo