From 584d919794127c0527f4b2e6e7b0a3673b00723f Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Tue, 30 Jun 2020 16:17:12 -0400 Subject: [PATCH 1/5] slide 22 with valid.html --- js/slide22.js | 13 +++++++++++++ valid.html | 0 2 files changed, 13 insertions(+) create mode 100644 valid.html diff --git a/js/slide22.js b/js/slide22.js index e69de29..183ccc2 100644 --- a/js/slide22.js +++ b/js/slide22.js @@ -0,0 +1,13 @@ +// var userInput =""; +// //var number=0; +// do { +// userInput = prompt("Enter a number between 1 and 100"); +// } while(userInput<1 || userInput >100); +// console.log(userInput*userInput); + + var userInput= ""; + do{ + userInput= window.prompt("Please Enter a number"); + } while(userInput<0 || userInput>100); +alert("The number squared is" + userInput*userInput); + diff --git a/valid.html b/valid.html new file mode 100644 index 0000000..e69de29 From c72e7675297ef716a3d429bde99aa432dd94c9a4 Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Tue, 30 Jun 2020 18:32:33 -0400 Subject: [PATCH 2/5] slide 23 complete --- index.html | 51 +++------------------------------------ js/slide23.js | 13 ++++++++++ print-interval.html | 58 +++++++++++++++++++++++++++++++++++++++++++++ valid.html | 58 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+), 48 deletions(-) create mode 100644 print-interval.html diff --git a/index.html b/index.html index ef9a207..29bfa00 100644 --- a/index.html +++ b/index.html @@ -1,58 +1,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The quickest of brown foxes. + + + - - -
- - -
- - - - - - \ No newline at end of file diff --git a/js/slide23.js b/js/slide23.js index e69de29..b47b456 100644 --- a/js/slide23.js +++ b/js/slide23.js @@ -0,0 +1,13 @@ +let userInputLower= ""; +let userInputUpper=""; + + userInputLower= window.prompt("Please Enter L : "); + userInputUpper= window.prompt("Please Enter U : "); + + let arrayLength = userInputUpper-userInputLower; + var array=[]; + for(let i=0; i< arrayLength; i++){ + array[i] = parseInt(userInputLower) + i; + } + console.log(array) ; + alert(array); diff --git a/print-interval.html b/print-interval.html new file mode 100644 index 0000000..da537f1 --- /dev/null +++ b/print-interval.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The quickest of brown foxes. + + + + + + +
+ + +
+ + + + + + + + + \ No newline at end of file diff --git a/valid.html b/valid.html index e69de29..ef9a207 100644 --- a/valid.html +++ b/valid.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The quickest of brown foxes. + + + + + + +
+ + +
+ + + + + + + + + \ No newline at end of file From 4845bd71dd2026b5ccd116179ba6796b40f0a016 Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Tue, 30 Jun 2020 18:57:11 -0400 Subject: [PATCH 3/5] slide 24 complete --- index.html | 2 +- js/slide24.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 29bfa00..e1ff5fa 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - + diff --git a/js/slide24.js b/js/slide24.js index e69de29..6c12ba1 100644 --- a/js/slide24.js +++ b/js/slide24.js @@ -0,0 +1,20 @@ +var mydata=[]; +let userInputIndex= ""; +let userInputValue=""; + +for(let i=0; i< 10; i++){ + mydata[i] = 1; +} +console.log(mydata); + +do{ + userInputIndex= window.prompt("Please Enter Index : "); + if(userInputIndex >=10){ + break; + } + userInputValue= window.prompt("Please Enter Value : "); + mydata[userInputIndex] = userInputValue; + } while(userInputIndex >=0 && userInputIndex < 10); + console.log(mydata); + + From d98013065ef9bde589b277376b953643d7f8019f Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Tue, 30 Jun 2020 19:18:55 -0400 Subject: [PATCH 4/5] slide 25 and 26 complete --- fibonacci.html | 0 index.html | 2 +- js/slide25.js | 19 +++++++++++++++++++ js/slide26.js | 12 ++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 fibonacci.html diff --git a/fibonacci.html b/fibonacci.html new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html index e1ff5fa..85f56f4 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - + diff --git a/js/slide25.js b/js/slide25.js index e69de29..8eb569a 100644 --- a/js/slide25.js +++ b/js/slide25.js @@ -0,0 +1,19 @@ +var mydata=[]; +let userInputIndex= ""; +let userInputValue=""; + +for(let i=0; i< 10; i++){ + mydata[i] = 1; +} +console.log(mydata); + +do{ + userInputIndex= window.prompt("Please Enter Index : "); + if(userInputIndex >=10){ + console.log("Index out of range"); + break; + } + userInputValue= window.prompt("Please Enter Value : "); + mydata[userInputIndex] = userInputValue; + } while(userInputIndex >=0 && userInputIndex < 10); + console.log(mydata); \ No newline at end of file diff --git a/js/slide26.js b/js/slide26.js index e69de29..ca83e42 100644 --- a/js/slide26.js +++ b/js/slide26.js @@ -0,0 +1,12 @@ +function fibonacci(number){ +if(number == 0){ + return 0; +} +if(number == 1){ + return 1; +} +return (fibonacci(number-1) + fibonacci(number - 2)) +} +for(let i = 0; i< 59; i++){ + console.log(fibonacci(i)); +} From c6963d92896634d762ac1f6a78049a1498c7c1d5 Mon Sep 17 00:00:00 2001 From: mondira-roy2020 Date: Tue, 30 Jun 2020 19:25:16 -0400 Subject: [PATCH 5/5] updated readme.md --- README.md | 51 ++++++++++----------------------------------------- 1 file changed, 10 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 757e9c6..2148e79 100644 --- a/README.md +++ b/README.md @@ -6,47 +6,16 @@ * iterables * **Description** - Please complete the hands on exercises on [slides](https://docs.google.com/presentation/d/e/2PACX-1vTLTPpI0CX-AxgZIFuTKe4BgrEKyPFrEN9EktgLv5ep0xHf3cbxi8HymgCwmoyunA/pub?start=false&loop=false&delayms=3000#slide=id.p22) 22 to 26 +Slide 22 was the most time taking. +Learning from slide 23: +for(let i=0; i< arrayLength; i++){ + array[i] = (userInputLower) + i; + } + console.log(array) ;// given lower=5 and upper = 10 output was "50","51","52","53","54"... + for(let i=0; i< arrayLength; i++){ + array[i] = parseInt(userInputLower) + i; + } + console.log(array) ;// gives the correct numerical output - -## How to Download - -#### Part 1 - Forking the Project -* To _fork_ the project, click the `Fork` button located at the top right of the project. - - -#### Part 2 - Navigating to _forked_ Repository -* Navigate to your github profile to find the _newly forked repository_. -* Copy the URL of the project to the clipboard. - -#### Part 3 - Cloning _forked_ repository -* Clone the repository from **your account** into the `~/dev` directory. - * if you do not have a `~/dev` directory, make one by executing the following command: - * `mkdir ~/dev` - * navigate to the `~/dev` directory by executing the following command: - * `cd ~/dev` - * clone the project by executing the following command: - * `git clone https://github.com/${MYUSERNAME}/${NAMEOFPROJECT}` - - - - - - -## How to Submit - -#### Part 1 - _Pushing_ local changes to remote repository -* from a _terminal_ navigate to the root directory of the _cloned_ project. -* from the root directory of the project, execute the following commands: - * add all changes - * `git add .` - * commit changes to be pushed - * `git commit -m 'I have added changes'` - * push changes to your repository - * `git push -u origin master` - -#### Part 2 - Submitting assignment -* from the browser, navigate to the _forked_ project from **your** github account. -* click the `Pull Requests` tab. -* select `New Pull Request`