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` diff --git a/fibonacci.html b/fibonacci.html new file mode 100644 index 0000000..e69de29 diff --git a/index.html b/index.html index ef9a207..85f56f4 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/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/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/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); + + 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)); +} 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 new file mode 100644 index 0000000..ef9a207 --- /dev/null +++ b/valid.html @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The quickest of brown foxes. + + + + + + + + + + + + + + + + \ No newline at end of file