These are chat archives for LPM42/JavaScript_Foundations_2

15th
Dec 2014
Stephanie Beaton
@StephanieBeaton
Dec 15 2014 02:55

Quiz 6 - question about "Have at least one child class over-ride a property"
But how exactly does a child class override a property of its parent class?

can the same property ("property1" for example) be in both parent and child constructors?

Or do we say --

function Child (x) {
this.x = x;
}

function Parent(y) {
this.z = "z1";
this.y = y;
}

Child.prototype = new Parent("y");

Child.prototype.z = "z2";

Child.prototype = new Parent("y");
Child.prototype.z = "z2";

would be over-writing the value of z in the parent. over-riding means putting the value earlier in the prototype chain.

so:

function Child() {
this.z = "z2";
}

is over-riding

Ansoo Chang
@anschang
Dec 15 2014 06:14
Question 2 lab3 - is this a fibonacci sequence?
Stephanie Beaton
@StephanieBeaton
Dec 15 2014 19:35

Question 2 lab3 - i think this is not Fibonacci

during hour 1 rate of consumption = 1
during hour 2 rate of consumption = 2 total people eaten = 2 + 1 = 3
during hour 3 rate of consumption = 3 total people eaten = 3 + 2 + 1 = 6
.......

at the end of hour n when there are no more people to eat
rate of consumption = n
total people eaten = n + (n-1) + (n-2) +... +3+2+ 1

Stephanie Beaton
@StephanieBeaton
Dec 15 2014 19:44

which equals (n+1)n/2 i think. google it.

Fibonacci is n = (n-1) + (n-2)
0
1
1 = 0 + 1
3 = 2 + 1
5 = 3 + 2
8 = 5 + 3
13 = 8 + 5
n = (n-1) + (n-2)

Stephanie Beaton
@StephanieBeaton
Dec 15 2014 20:37
@lpm42 i looked at "bootstrap" website. Not sure where to start with installing it. Not sure if I should install on my Windows 8.1 laptop or on my Ubuntu latop. Do you have time to look at this sometime?
'P divy' (Ingrid)
@icuthy
Dec 15 2014 20:46
@anschang and @StephanieBeaton Question2 lab3. I think the key is that the blob gets faster and stronger after each person he eats. So we need to calculate the total amount of time considering that the first person takes 1 hour, (now the rate is 2 people per hour) so the second person would take an hour divided by 2, the third person an hour divided by 3....... and so on. And we add the totals until we reach the last unfortunate resident of Dowington. :)
Livingston Martin
@LPM42
Dec 15 2014 21:11

@StephanieBeaton
Absolutly!
So the easiest way to use/install it is to:

1. Go to this link: http://getbootstrap.com/getting-started/