Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions assignments/hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ <h1>Assignment</h1>
<li>Then print the message the user wrote into the <code>body</code> tag wrapped around an <code>h1</code> tag</li>
<li>Finally, change the <code>title</code> tag with the contents of the message</li>
</ul>
<script type = "text/javascript">
var message = prompt("What would you like to say?"), "Hello WOrld");
alert(message);
document.write('<h1>' + message + '</h1>');
document.querySelector('title').innerHTML = "Foo"
</script>

</body>
</html>
7 changes: 7 additions & 0 deletions psets/0.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ Why pay a fortune teller when you can just program your fortune yourself?
*/

// write your solution here...

var numChildren = 4;
var partnerName = "FatboyFlex";
var location = "Indian Ocean";
var job = "The Wackness"

console.log("You will be a" + job + "in" + location + "and married to" + partnerName + "with" + numChildren + "kids.");
8 changes: 8 additions & 0 deletions psets/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ Forgot how old someone is? Calculate it!
*/

// write your solution here...

var year = 2014;
var birthYear = 1870;

var age = year - birthYear;
var ageOther = year - (birthYear - 1);

console.log("They are either" + age + "or" + ageOther ".");
8 changes: 8 additions & 0 deletions psets/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,11 @@ Ever wonder how much a "lifetime supply" of your favorite snack is? Wonder no mo
*/

// write your solution here...

var age = 31;
var maxAge = 110;
var snackPerDay = 5;

var totalSnacks = ((maxAge - age) * 365) * 5

console.console.log("You will need" + totalSnacks + "to last you until the ripe old age of" + maxAge);
9 changes: 9 additions & 0 deletions psets/3.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ http://math2.org/math/geometry/circles.htm
*/

// write your solution here...

var radius = 643;
var circumference = 2 * 3.14 * radius;

console.console.log("The circumference is" + circumference + ".");

var area = 3.14 * radius^2;

console.console.log("The area is" + area ".");
9 changes: 9 additions & 0 deletions psets/4.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ http://www.mathsisfun.com/temperature-conversion.html
*/

// write your solution here...

var temp = 34;
var newTemp = (temp * 2) + 30;

console.console.log(temp"C is " + newTemp + "F.");

var fahrenheit = newTemp;

console.console.log(fahrenheit+ "F is" + temp + "C.");
6 changes: 6 additions & 0 deletions psets/5.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ For example:

function drEvil(amount) {
// write your solution here...
if (amount >= 1000000)
return amount + "dollars";
else
return amount + "dollars (pinky)";


}
5 changes: 5 additions & 0 deletions psets/6.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ Look up the JavaScript string reference to find methods which may be useful!

function mixUp(a, b) {
// write your solution here...
var aTemp = a;
var bTemp = b;



}
13 changes: 11 additions & 2 deletions psets/7.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ For example:

fixStart('babble'): 'ba**le'
*/

<script>
function fixStart(s) {
// write your solution here...
}
j = s.length;

for (i = 0; i < j; i++)
if (s[i] == s[i]
{
s[i] == '*';
}
return s;
}
</script>