diff --git a/edit-array.html b/edit-array.html new file mode 100644 index 0000000..aa09bc0 --- /dev/null +++ b/edit-array.html @@ -0,0 +1,28 @@ + + + + + + +
+ + + + + + + + + + + + + The quickest of brown foxes. + + + + + + + + \ No newline at end of file diff --git a/fibonnaci.html b/fibonnaci.html new file mode 100644 index 0000000..dbcf6c9 --- /dev/null +++ b/fibonnaci.html @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + The quickest of brown foxes. + + + + + + + + \ No newline at end of file diff --git a/index.html b/index.html index ef9a207..7d2bbdf 100644 --- a/index.html +++ b/index.html @@ -14,25 +14,7 @@ - - - - - - - - - - - - - - - - - - - + diff --git a/js/slide22.js b/js/slide22.js index e69de29..9d34c42 100644 --- a/js/slide22.js +++ b/js/slide22.js @@ -0,0 +1,17 @@ +// using a do while loop +let userInput; +do { + userInput = prompt("Enter a number greater than 0 and less than 100"); +} while((userInput <= 0) || (userInput >= 100)); +alert("You entered "+ userInput*userInput); + +// using a while loop + +// let userInput = prompt("Enter a number greater than 0 and less than 100"); +// while((userInput <= 0) || (userInput >= 100)) { +// userInput = prompt("Enter a number greater than 0 and less than 100"); +// } +// alert("You entered "+ userInput*userInput); + + +// I personally like do while loop for this case better since I can read the code from top to bottom and without repeat myself. \ No newline at end of file diff --git a/js/slide23.js b/js/slide23.js index e69de29..e5199a1 100644 --- a/js/slide23.js +++ b/js/slide23.js @@ -0,0 +1,7 @@ +let lowerLimit = prompt("Enter lower limit"); +let upperLimit = prompt("Enter upper limit"); +let array = []; +for(let i = lowerLimit ; i < upperLimit ; i++) { + array.push(i); +} +alert(array); \ No newline at end of file diff --git a/js/slide24.js b/js/slide24.js index e69de29..de3a36d 100644 --- a/js/slide24.js +++ b/js/slide24.js @@ -0,0 +1,18 @@ +let myData = new Array(10); +let cellIndex; +let newValue; +for (let i = 0; i < myData.length ; i++) { + myData[i]=1; +} +while(1) { + console.log(myData); + cellIndex = prompt("Enter the cell index"); + newValue = prompt("Enter the new value"); + if ((cellIndex < 0 || cellIndex >= myData.length)) { + alert("Invalid Input"); + break; + } else { + myData[cellIndex] = parseInt(newValue); + } +} + \ No newline at end of file diff --git a/js/slide25.js b/js/slide25.js deleted file mode 100644 index e69de29..0000000 diff --git a/js/slide26.js b/js/slide26.js index e69de29..c6c495c 100644 --- a/js/slide26.js +++ b/js/slide26.js @@ -0,0 +1,7 @@ +let newArray = [0,1]; +for(let i = 2 ; i < 59; i++ ) { + let newValue = newArray[i-1] + newArray[i-2] + newArray.push(newValue); +} + +console.log(newArray); diff --git a/print-interval.html b/print-interval.html new file mode 100644 index 0000000..bfbd5f2 --- /dev/null +++ b/print-interval.html @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + The quickest of brown foxes. + + + + + \ No newline at end of file