diff --git a/JavaScript1/Week1/Destance.js b/JavaScript1/Week1/Destance.js new file mode 100644 index 00000000..080a6f03 --- /dev/null +++ b/JavaScript1/Week1/Destance.js @@ -0,0 +1,9 @@ +// From hours to minutes +let hours = 72; +let minutes = 120; +let fromHoursToMinutes = (60* hours + minutes); +//From minutes to second +let second = 30*10^-5 +let fromMinutesToSecond = (60* second + minutes); + + diff --git a/JavaScript1/Week1/Dog-age.js b/JavaScript1/Week1/Dog-age.js new file mode 100644 index 00000000..b1b4e0d6 --- /dev/null +++ b/JavaScript1/Week1/Dog-age.js @@ -0,0 +1,8 @@ +let dogYearOfBirth= 2017; +let dogYearfuture=2027; +let dogYear=dogYearFuture-dogYearOfBirth; +let shouldSeeResultOfDogYear=false; +if(shouldSeeResultOfDogYear!=true) + console.log("my dog will be " +dogYear + " human year "+ dogYearfuture); +else + console.log("my dog will be " +dogYear*7 + "dog year "+ dogYearFuture), \ No newline at end of file diff --git a/JavaScript1/Week1/House-price.js b/JavaScript1/Week1/House-price.js new file mode 100644 index 00000000..de1ed05f --- /dev/null +++ b/JavaScript1/Week1/House-price.js @@ -0,0 +1,34 @@ +// Calculation for Peter +let height= 10; +let width= 8; +let depth= 10; +let garderSize= 100 +let volumeInMeters= height*depth*width; +let housePrice= volumeInMeters*2.5*1000 + garderSize*300; +console.log("height= " + height + " m"); +console.log("width= " + width + " m"); +console.log("depth= " + depth + " m"); +console.log("Volume=" + volumeInMeters + " m^3"); +console.log("Gardern size= "+ gardernSize + "m^2"); +console.log("Calculation price= dkk " + housePrice); +if(housePrice<=2500000) + console.log("it is a good price for Peter" + housePrice); +else + console.log("it is not agood price for Peter" + housePrice); +// Calculation for Julia +let height= 8; +let width= 5; +let depth= 11; +let garderSize= 70 +let volumeInMeters= height*depth*width; +let housePrice= volumeInMeters*2.5*1000 + garderSize*300; +console.log("height= " + height + " m"); +console.log("width= " + width + " m"); +console.log("depth= " + depth + " m"); +console.log("Volume=" + volumeInMeters + " m^3"); +console.log("Gardern size= "+ gardernSize + "m^2"); +console.log("Calculation price= dkk " + housePrice); +if(housePrice<=100000) + console.log("it is a good price for Julia" + housePrice); + else + console.log("it is not agood price for Julia" + housePrice); \ No newline at end of file diff --git a/JavaScript1/Week1/Intersting-words.js b/JavaScript1/Week1/Intersting-words.js new file mode 100644 index 00000000..0f83bcc1 --- /dev/null +++ b/JavaScript1/Week1/Intersting-words.js @@ -0,0 +1,10 @@ +let firstWords=["Univerce","Star","Worlds","Dimentions","Planets","Black hole","Galaxies","Comets","Aliens","Big Bang"]; +let secondWords=["Beauty","Brighten","Darknees","Power","Heat","Fair","Idealistic","Mysterious","Deep","Creative"]; +for(let i=0<10;i++) +{ + const randomNumber1 = Math.floor(math.random() * 10); + const randomNumber2 = Math.floor(math.random() * 10); + startupName=firstWords[randomNumber1]+" " + secondWords[randomNumber2]; + statupLength=startupName.length; + console.log("Name : "+startupName+"\t\tLength="+startupLength); +} \ No newline at end of file diff --git a/JavaScript1/Week1/Language.js b/JavaScript1/Week1/Language.js new file mode 100644 index 00000000..9bd643b2 --- /dev/null +++ b/JavaScript1/Week1/Language.js @@ -0,0 +1,9 @@ +console.log("Silav ji we hemuyan re");// Kurdish +console.log("Marhaba ayuha alealam");// Arabic +console.log("Merhaba dunya");// Turkish +console.log(" Hej Verden");// Danish +let f=7,25; +console.log("Rounded value of " + f + "=" +Math.round(f)); +console.log("Worked"); + + diff --git a/JavaScript1/Week1/My-age.js b/JavaScript1/Week1/My-age.js new file mode 100644 index 00000000..ade9c162 --- /dev/null +++ b/JavaScript1/Week1/My-age.js @@ -0,0 +1,4 @@ +let yearOfBirth= 1996; +let futureYear= 2027; +let futureAge= futureYear - yearOfBirth; +console.log("my age in " +futureYear + will be = "+ futureAge"); diff --git a/JavaScript1/Week2/week2.js b/JavaScript1/Week2/week2.js new file mode 100644 index 00000000..2ede3f55 --- /dev/null +++ b/JavaScript1/Week2/week2.js @@ -0,0 +1,34 @@ +// create a function that returns an empty object. +let emptyObject= []; +function emptyOne(){ + return {}; +} + + +// Creat a variable, timeObject and creat a function and add key (12) +let timeObject = ("time:"); +function object (){ + +} +console.log("time:"+ 12); + + +// Creat array that have three empty object +let emptyArray = []; +function threeEmptyObject(empty1, empty2, empty3){ + console.log(" "+empty1+ " " +empty2+ " "+empty3); +} + + + +//Call a function, has variable colorObject + +function threeColor(color:){ + return threeColor; + +} +console.log(Pink, Black, Blue); + + +//Meeting friend at Tuesday arrayObject =[ {color: 'Blue'}, {color:'Black'},{color:'Pink'}]; + diff --git a/JavaScript1/Week3/La_nature_dans_la_physique_contemporaine.jpg b/JavaScript1/Week3/La_nature_dans_la_physique_contemporaine.jpg new file mode 100644 index 00000000..e32ba525 Binary files /dev/null and b/JavaScript1/Week3/La_nature_dans_la_physique_contemporaine.jpg differ diff --git a/JavaScript1/Week3/Mind map.jpg b/JavaScript1/Week3/Mind map.jpg new file mode 100644 index 00000000..f95fecef Binary files /dev/null and b/JavaScript1/Week3/Mind map.jpg differ diff --git a/JavaScript1/Week3/Universe frome nothing.jpg b/JavaScript1/Week3/Universe frome nothing.jpg new file mode 100644 index 00000000..67195fa2 Binary files /dev/null and b/JavaScript1/Week3/Universe frome nothing.jpg differ diff --git a/JavaScript1/Week3/faster than speed og light.jpg b/JavaScript1/Week3/faster than speed og light.jpg new file mode 100644 index 00000000..e9047ccd Binary files /dev/null and b/JavaScript1/Week3/faster than speed og light.jpg differ diff --git a/JavaScript1/Week3/file2.html b/JavaScript1/Week3/file2.html new file mode 100644 index 00000000..55dfaad5 --- /dev/null +++ b/JavaScript1/Week3/file2.html @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JavaScript1/Week3/genome-matt-ridley.jpg b/JavaScript1/Week3/genome-matt-ridley.jpg new file mode 100644 index 00000000..8695abb9 Binary files /dev/null and b/JavaScript1/Week3/genome-matt-ridley.jpg differ diff --git a/JavaScript1/Week3/new-file1.js b/JavaScript1/Week3/new-file1.js new file mode 100644 index 00000000..390510e7 --- /dev/null +++ b/JavaScript1/Week3/new-file1.js @@ -0,0 +1,138 @@ + + /* + var Books = ['faster-than-speed-of-light', + 'genome', + 'nature-in-contemporary-physics', + ' the-first-three-minutes-of-the-life-of-the-universe', + 'relativity-and-the-nature-of-space-time', + 'mind map', + 'physics-of-the-impossible', + 'the-brian', + 'other-worlds', + 'universe-from-nothig' + ]; + +console.log(books); + +function bookList() { + let x = document.createElement('ul'); + document.body.appendChild(x); + for(let i = 0; i + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/JavaScript2/Week4/week4.js b/JavaScript2/Week4/week4.js new file mode 100644 index 00000000..a430abe4 --- /dev/null +++ b/JavaScript2/Week4/week4.js @@ -0,0 +1,37 @@ + +//I started from spirit animal becouse the first section i did it in week3. +//Create an input element, a button and a tag + +let myInput = document.getElementById('input'); +document.getElementById('input').addEventListener("click" , function() { + document.getElementById("input").innerHTML = 'Virgeen' +}) + +const myButton = docuement.createElement('button'); +document.body.appendChild('myButton'); +document.querySelector('button').addEventListener('click', () => console.log('Virgeen: The rare lion')); + +let myTag = document.createElement('div'); + let myInput = document.querySelector('input'); +myButton = document.querySelector('button'); +myTag.insertBefore(input, button); + +//Create an array with 10 string representing spirit animals + +let spiritAnimals = [ + 'Dolphin', 'Oyster', 'Starfish', 'Bear', 'Hourse', 'Turtle', 'Shark', 'Shells', 'Crocodile', 'Snake' +]; + +// get a random item in the array that will represent the spirit animal. + +var randomItem = spiritAnimals[Math.floor(Math.random() + *spiritAnimals.length)]; +document.body.innerHTML = randomItem; + +//create functionality where a user can press a button and then get a new spirit animal. + +document.getElementById('button').addEventListener('click',function(){ + const randomValue = Math.floor(Math.random* 10); + document.getElementById.innerHTML = spiritAnimals[randomValue] + +}) \ No newline at end of file diff --git a/JavaScript2/Week5/index1 week 5.html b/JavaScript2/Week5/index1 week 5.html new file mode 100644 index 00000000..dcbf27fb --- /dev/null +++ b/JavaScript2/Week5/index1 week 5.html @@ -0,0 +1,14 @@ + + + + + + Document + + + + + + + + \ No newline at end of file diff --git a/JavaScript2/Week5/index1.js week 5.js b/JavaScript2/Week5/index1.js week 5.js new file mode 100644 index 00000000..405ee049 --- /dev/null +++ b/JavaScript2/Week5/index1.js week 5.js @@ -0,0 +1,103 @@ +//I created function with four argument + +function fourArgument(startValue, slutValue, callThree, callFive) { + let startValue = 0; + let slutValue = 10; + let creatArray = [ ];//This is my empty array to push start value and slut value + for (var i = 0, i < startValue; i++ ) { + for (var j = 0; j < slutValue-1; j++ ) { + creatArray.push(startValue, slutValue, callThree, callFive); + + } + } + + +} +//I created a function with argument callThree +function callThree(number) { + if (number% 3 === 0) { + return 'value is divisble by 3' + }else { + return 'It is can not be divisible by 3' + } + +} +//I created a function with argument callFive +function callFive(number) { + if (number% 5 === 0){ + return 'value is divisible by 5' + }else { + return 'It is can not be divisible by 5' + } +} + +console.log(fourArgument(2, 3, callThree, callFive)); +console.log(creatArray.length); //i am not sure if i can put length inside console.log + +//add a button and input element +let myButton = document.getElementById('button').addEventListener('click', () => { + let myInput = document.querySelector('.num').value; + console.log('you clicked me!') + if (myButton = clicked ) { + alert('write a number') + }else if (myInput % 3 === 0) { + document.body.style.backgroundColor = "blue"; + } else if(myInput% 5=== 0) { + document.body.style.backgroundColor = "yellow"; + }else { + document.body.style.backgroundColor = "white"; + } + + + + }); + //Create a button with text'show location + let myNewButton = document.getElementById('.map').addEventListener('click', () => { + let info = function initMap() { + map = new google.maps.Map(document.getElementById('map'), { + center: {lat: -34.397, lng: 150.644},//this is wrong key i tried to find it in(Google Cloud Platform)but it was not easy. + zoom: 8 + }); + }); + + //Create an array with 3 items. All items should be functions and call them + + theArrays = [ + array1 = function(){console.log('the first array')}, + array2 = function(){console.log('the second array')}, + array3 = function(){console.log('the third array')} + ]; + + console.log(theArrays); + + //Create a function as a const and try creating a function normally. Call both function + const creatFunction1 = function() { + console.log('This is the first function'); + } + let creatFunction2 = function() { + console.log('This the second function'); + }; + + //Create an object that has a key whose value is a function. Try calling this function. + let creatObject = { + myKey: function() { alert('This is my object')} + }; + creatObject.myKey(); + + //Creat setTimeout uses a function that is defined as a const. +const mySetTimeout = function thisCode() { + setTimeout("thisCode()", 2000); +} + +// Creat an anonomous function that is defined inside the setTimeout. + setTimeout(function(){"good job"},3000); + +//Create a function (outer) that returns a function (inner) +function outer() { + return function inner() { + console.log("This is inner function"); + } +} +//Call the outer function and assign the return to a variable. +console.log(outer()); + \ No newline at end of file