Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 10 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Empty file added fibonacci.html
Empty file.
51 changes: 3 additions & 48 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,58 +1,13 @@
<!DOCTYPE html>
<html lang="en">

<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<head> <!-- header begins here -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<link href="./css/style.css" rel="stylesheet">
<script type="text/javascript" src="./js/header-functions.js"></script>
<script type="text/javascript" src="./js/slide22.js"></script>

</head> <!-- header ends here -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->












<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<body> <!-- body begins here -->


The quickest of brown foxes.


<link href="./css/style.css" rel="stylesheet">
<!-- <script type="text/javascript" src="./js/header-functions.js"></script> -->
<script type="text/javascript" src="./js/slide26.js"></script>


<!-- ====================================================== -->
<!-- ====================================================== -->
<footer>
<!-- footer of page begins here -->
<script type="text/javascript" src="./js/footer-functions.js"></script>
</footer> <!-- footer of page ends here -->
<!-- ====================================================== -->
<!-- ====================================================== -->

</body>
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->

</html>
13 changes: 13 additions & 0 deletions js/slide22.js
Original file line number Diff line number Diff line change
@@ -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);

13 changes: 13 additions & 0 deletions js/slide23.js
Original file line number Diff line number Diff line change
@@ -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);
20 changes: 20 additions & 0 deletions js/slide24.js
Original file line number Diff line number Diff line change
@@ -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);


19 changes: 19 additions & 0 deletions js/slide25.js
Original file line number Diff line number Diff line change
@@ -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);
12 changes: 12 additions & 0 deletions js/slide26.js
Original file line number Diff line number Diff line change
@@ -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));
}
58 changes: 58 additions & 0 deletions print-interval.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">

<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<head> <!-- header begins here -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<link href="./css/style.css" rel="stylesheet">
<!-- <script type="text/javascript" src="./js/header-functions.js"></script> -->
<script type="text/javascript" src="./js/slide23.js"></script>

</head> <!-- header ends here -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->












<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<body> <!-- body begins here -->


The quickest of brown foxes.




<!-- ====================================================== -->
<!-- ====================================================== -->
<footer>
<!-- footer of page begins here -->
<!-- <script type="text/javascript" src="./js/footer-functions.js"></script> -->
</footer> <!-- footer of page ends here -->
<!-- ====================================================== -->
<!-- ====================================================== -->

</body>
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->

</html>
58 changes: 58 additions & 0 deletions valid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">

<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<head> <!-- header begins here -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">

<link href="./css/style.css" rel="stylesheet">
<script type="text/javascript" src="./js/header-functions.js"></script>
<script type="text/javascript" src="./js/slide22.js"></script>

</head> <!-- header ends here -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->
<!-- ----------------------------------------------------------------- -->












<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<body> <!-- body begins here -->


The quickest of brown foxes.




<!-- ====================================================== -->
<!-- ====================================================== -->
<footer>
<!-- footer of page begins here -->
<script type="text/javascript" src="./js/footer-functions.js"></script>
</footer> <!-- footer of page ends here -->
<!-- ====================================================== -->
<!-- ====================================================== -->

</body>
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->
<!-- ---------------------------------------------------------------------------------- -->

</html>