Skip to content

Commit 4d25d95

Browse files
committed
w2 done
1 parent de88b6e commit 4d25d95

File tree

21 files changed

+496
-0
lines changed

21 files changed

+496
-0
lines changed

week2-datatypes_functions/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Week 2
2+
3+
## Objectives
4+
- I can control program flow using while loops
5+
- I can create custom functions.
6+
7+
8+
9+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<html>
2+
<head>
3+
<title>do now</title>
4+
</head>
5+
<body>
6+
<script type="text/javascript" src="donow.js"></script>
7+
</body>
8+
</html>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var cash = 15;
2+
3+
var numCandyBars = prompt('How many candy bars do you want to buy?')
4+
5+
var cost = numCandyBar * 0.75;
6+
7+
cash = cash - cost;
8+
alert = cash;
9+
10+
if(cash = 0){
11+
alert('you're out of money!')
12+
}
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>functions demo</title>
4+
</head>
5+
<body>
6+
<h1>Open the console</h1>
7+
<script src="functions_demo.js"></script>
8+
</body>
9+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
console.log('working');
2+
3+
// super simple
4+
// this function will just alert "hello" when called
5+
6+
// Function to see if two numbers are even
7+
// use the % operator
8+
9+
// Function that will return a random number up to a given value
10+
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<html>
2+
<head>
3+
<title>blondie</title>
4+
</head>
5+
<body>
6+
<h1>Functions Practice</h1>
7+
<p>Open your console to check your code</p>
8+
<script type="text/javascript" src="functions.js"></script>
9+
10+
</body>
11+
</html>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Less Than
2+
// - Write a function min that takes two arguments and returns the small value.
3+
4+
// Fizz Buzz
5+
// - Write a function that takes in a test number.
6+
// - If the number can be divided by 3 with no remainder, print "fizz"
7+
// - If the number can be divided by 5 with no remainder, print"buzz"
8+
// - If the number is divisible by both 5 and 3, print "fizzbuzz"
9+
// HINT, check out the % operator
10+
// Challenge, use while operator to check values 0 to 100
11+
// Make sure you have a check to stop the while loop
12+
13+
// TuTone (Challenge!)
14+
// - create a function called "jenny" that simply returns "867-5309" when called.
15+
// - Write another function called "tommy" that takes the jenny function as a parameter.
16+
// - store a message, "Jenny I've called your number " + and then execute the telephone function passed to it.
17+
// - alert the message
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<html>
2+
<head>
3+
<title></title>
4+
</head>
5+
<body>
6+
<h1>Open the Console!</h1>
7+
<p>On a mac, ctrl + click anywhere then choose inspect</p>
8+
<p>On a pc, right click anywhere then choose inspect</p>
9+
<script src="logic_demo.js"></script>
10+
</body>
11+
</html>

week2-datatypes_functions/logic/logic_demo/logic_demo.js

Whitespace-only changes.

0 commit comments

Comments
 (0)