From 26c80183da8bfcdbe8f8176ccdab30dbb5617e6b Mon Sep 17 00:00:00 2001 From: Jose Cruz Date: Tue, 30 Jun 2020 13:06:23 -0400 Subject: [PATCH 1/2] finished slide 22 and, slide 23 --- edit-array.html | 19 +++++++++++++++++++ js/slide22.js | 9 +++++++++ js/slide23.js | 7 +++++++ js/slide24.js | 19 +++++++++++++++++++ print-interval.html | 18 ++++++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 edit-array.html create mode 100644 print-interval.html diff --git a/edit-array.html b/edit-array.html new file mode 100644 index 0000000..f68cd11 --- /dev/null +++ b/edit-array.html @@ -0,0 +1,19 @@ +edit-array + + + + + + + + + + + + edit-array + + + + + + \ No newline at end of file diff --git a/js/slide22.js b/js/slide22.js index e69de29..cdded61 100644 --- a/js/slide22.js +++ b/js/slide22.js @@ -0,0 +1,9 @@ +let user= prompt("Enter a number greater than 0 and less than 100: ") + + +while(user>=100 || user<=0) +{ + user=prompt("Re-enter a number greater than 0 and less than 100: ") +} +user=user*user +document.write("\n"+user) diff --git a/js/slide23.js b/js/slide23.js index e69de29..cb5a870 100644 --- a/js/slide23.js +++ b/js/slide23.js @@ -0,0 +1,7 @@ +let lower=prompt("Please enter L: "); +let upper=prompt("Please enter U: "); + +for(let i=lower;i + + + + + + + + + print print-interval + + + + + + \ No newline at end of file From 37b235b9b3039c3326cfd80da4db7fc8249dcf0f Mon Sep 17 00:00:00 2001 From: Jose Cruz Date: Tue, 30 Jun 2020 16:20:59 -0400 Subject: [PATCH 2/2] finished slide 24 and, slide 26 --- fibonacci.html | 18 ++++++++++++++++++ js/slide24.js | 14 ++++++++++---- js/slide26.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 fibonacci.html diff --git a/fibonacci.html b/fibonacci.html new file mode 100644 index 0000000..62e97dd --- /dev/null +++ b/fibonacci.html @@ -0,0 +1,18 @@ +fibonacci + + + + + + + + + + + fibonacci + + + + + + \ No newline at end of file diff --git a/js/slide24.js b/js/slide24.js index 0dda105..f9f7630 100644 --- a/js/slide24.js +++ b/js/slide24.js @@ -1,7 +1,4 @@ let firstArray=new Array(10); -let position=prompt("Enter a position in the index from 0-9") -let choice=prompt("Enter the number you wan to change the value in this index") - //fills all values in the array with 1's for(let i=0;i<10;i++) { @@ -16,4 +13,13 @@ console.log(firstArray); // in a loop that keeps going until its not in range exit the javascript // if -while() \ No newline at end of file +let position=prompt("input index") + + +while(position>0 && position<10){ + let choice=prompt("input value"); + firstArray[position]=parseInt(choice); + position=prompt("input index") +} +console.log(firstArray); +console.log("index out of range!. goodbye :(") \ No newline at end of file diff --git a/js/slide26.js b/js/slide26.js index e69de29..c3aeb0d 100644 --- a/js/slide26.js +++ b/js/slide26.js @@ -0,0 +1,29 @@ + +var input =prompt("Enter a number for a fibioncci sequence") +input=parseInt(input); +var f=[]; +f[0]=0 +f[1]=1 + +while(input>59 || input<0) +{ + input=prompt("Re-enter a number for a fibioncci sequence") +} + +if(input==0) +{ + console.log(f[0]) +} + +if(input==1) +{ + console.log(f[1]) +} + + + +for(var i=2;i<=input;i++) +{ + f[i]=f[i-2]+ f[i-1] + console.log(f[i]+"\n\t"); +} \ No newline at end of file