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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
29 changes: 29 additions & 0 deletions 1.hafta-2.projem/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>

#1a görev
const surucuYasi = 24
if (surucuYasi >=18) {
console.log(true);
} else {
console.log(false);
}

#1d görev

a = 7
b = 4
function carpma(a,b) {
return a*b;
}
console.log(carpma(a,b))
</script>
</body>
</html>
125 changes: 110 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Aşağıdakileri yap:

İPUCU: fonksiyon oluşturmaya gerek yok
*/
const surucuYasi = 18;
if (surucuYasi > 18) {
console.log(true);
} else {
console.log(false);
}

/*
Görev 1b - Değerler (puanlamaya dahil değildir)
Expand All @@ -31,6 +37,12 @@ Aşağıdakileri yap:

İPUCU: fonksiyon oluşturmaya gerek yok
*/
let birinciDeger = 5;
const ikinciDeger = 10;
if (birinciDeger > ikinciDeger) {
birinciDeger = 3;
console.log(birinciDeger);
}

/*
Görev 1c - String bir değeri Number'a dönüştürün (puanlamaya dahil değildir)
Expand All @@ -42,6 +54,11 @@ Aşağıdakileri yap:

İPUCU: Number metoduna bakabilirsin
*/
const stringDeger = "1999";
console.log(stringDeger);

const numberDeger = Number(stringDeger);
console.log(numberDeger);

/*
Görev 1d - Çarpma
Expand All @@ -52,9 +69,12 @@ Aşağıdakileri yaparak carpma isimli fonksiyonu tamamla:
3. console.log(carpma(7,4)) ile yazdığın fonsiyonu test edin. Console'da sonucu 28 olarak görmelisin.
*/

function carpma(/*buraya kodunu yazabilirsin*/) {
/*buraya kodunu yazabilirsin*/
const a = 7;
const b = 4;
function carpma(a, b) {
return a * b;
}
console.log(carpma(a, b));

/* Görev 2 : Köpeğin Yaşı */

Expand All @@ -65,9 +85,10 @@ Aşağıdakileri yap:
3. Hesaplanan köpeğin yaşını dönün.
*/

function kopeginYasi(/*buraya kodunu yazabilirsin*/) {
/*buraya kodunu yazabilirsin*/
function kopeginYasi(num) {
return num * 7;
}
console.log(kopeginYasi(6));

/* Görev 3 */
/*
Expand All @@ -84,7 +105,17 @@ OYUNUN KURALLARI: Makas Kağıdı yener| Kağıt Taşı yener | Taş Makas'ı ye
*/

function oyun(oyuncu, bilgisayar) {
/*buraya kodunu yazabilirsin*/
if (oyuncu === bilgisayar) {
return "Beraberlik";
} else if (
(oyuncu === "Taş" && bilgisayar === "Makas") ||
(oyuncu === "Makas" && bilgisayar === "Kağıt") ||
(oyuncu === "Kağıt" && bilgisayar === "Taş")
) {
return "Kazandın!";
} else {
return "Kaybettin!";
}
}

// Şimdi Taş, Kağıt, Makas oyununu bilgisayara karşı oynayalım!
Expand All @@ -99,9 +130,21 @@ function oyun(oyuncu, bilgisayar) {
4. Bu rastgele değeri "Taş", "Kağıt" veya "Makas"a dönüştüren bir koşul oluşturun
5. Oluşan değeri geri dönün


Şimdi kendi seçtiğin bir seçime karşı bilgisayarın rastgele oluşturduğu seçimi yukarıda yazdığın oyun fonsiyonu ile oynayın ve sonucu console'a yazdırın.
Örn: console.log(oyun("Makas",bilgisayarinSecimi()))
*/
function bilgisayarinSecimi(sey) {
sey = Math.random();
if (sey > 0.66) {
return "Makas";
} else if (sey > 0.33) {
return "Kağıt";
} else {
return "Taş";
}
}
console.log(oyun("Makas", bilgisayarinSecimi()));

/* Görev 4 : Metrik Dönüştürücü */

Expand All @@ -113,9 +156,12 @@ Aşağdaki milDonusturucu fonksiyonunu aşağıdakileri kullanarak tamamla:
3. Mil değerini geri dönün
*/

function milDonusturucu(/*buraya kodunu yazabilirsin*/) {
/*buraya kodunu yazabilirsin*/
function milDonusturucu(Kilometre) {
const birMil = 1.609344;
const mil = Kilometre * birMil;
return mil;
}
console.log(milDonusturucu(10));

//Görev 4b - Santimetreden Feet
/*
Expand All @@ -127,9 +173,12 @@ Aşağıdakileri feetDonusturucu fonsiyonunu kullanarak yap:
Google'da arama ipucu: "feet cm dönüştürme"
*/

function feetDonusturucu(/*buraya kodunu yazabilirsin*/) {
/*buraya kodunu yazabilirsin*/
function feetDonusturucu(santimetre) {
const birFeet = 30.48;
const feet = santimetre / birFeet;
return feet;
}
console.log(feetDonusturucu(1));

/* Görev 5 : 5 küçük maymun yatakta zıplamış şarkısını çocuklar için hazırladığımı varsayalım. https://www.youtube.com/watch?v=e4EJ34xnlxk */

Expand All @@ -144,8 +193,14 @@ Aşağıdakileri cocukSarkisi fonksiyonunda yap:
4. Bu döngüde, her seferinde cocukSarkisi fonsiyonu çalışsın ve console.log'a dönen metni yazdırsın.
*/

function cocukSarkisi(/*buraya kodunu yazabilirsin*/) {
/*buraya kodunu yazabilirsin*/
function cocukSarkisi(sayi) {
return (
sayi +
"küçük maymun yatakta zıplamış, biri düşüp başını çarpmış, Anne doktoru aramış, Doktor çok kızmış: Bir daha yatakta zıplamak yok!"
);
}
for (let i = 5; i > 0; i--) {
console.log(cocukSarkisi(i));
}

/* Görev 6 : Not Hesaplayıcı */
Expand All @@ -163,9 +218,20 @@ Aşağdakileri notHesapla fonksiyonunda yap.
dönün
*/

function notHesapla(/*buraya kodunu yazabilirsin*/) {
/*buraya kodunu yazabilirsin*/
function notHesapla(sınavSonucu) {
if (sınavSonucu >= 90 && sınavSonucu <= 100) {
return "A aldın";
} else if (sınavSonucu >= 80 && sınavSonucu <= 89) {
return "B aldın";
} else if (sınavSonucu >= 70 && sınavSonucu <= 79) {
return "C aldın";
} else if (sınavSonucu >= 60 && sınavSonucu <= 69) {
return "D aldın";
} else {
return "F aldın";
}
}
console.log(notHesapla(70));

/* Bonus Çalışma: Sesli harf sayacı - Kaç tane sesli harf var? */

Expand All @@ -178,9 +244,38 @@ Aşağıdakileri sesliHarfSayaci fonskiyonunda yap.
İPUCU - .includes() methoduna bakabilirsin. (https://www.w3schools.com/jsref/jsref_includes.asp)
*/

function sesliHarfSayaci(/*buraya kodunu yazabilirsin*/) {
/*buraya kodunu yazabilirsin*/
function sesliHarfSayaci(stringDegeri) {
const sesliHarfler = [
"A",
"E",
"İ",
"Ö",
"Ü",
"I",
"O",
"U",
"a",
"e",
"i",
"ö",
"ü",
"ı",
"o",
"u",
];

let sayac = 0;
for (let i = 0; i < stringDegeri.length; i++) {
const karakter = stringDegeri[i];
if (sesliHarfler.includes(karakter)) {
sayac++;
}
}
return sayac;
}
const stringDegeri = "Bugün hava çok güzel.";
const sesliHarfler = sesliHarfSayaci(stringDegeri);
console.log(sesliHarfler);

/* Lütfen bu satırın alt tarafını değiştirmeyin */
function sa() {
Expand Down
2 changes: 2 additions & 0 deletions node.modules/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node.modules/

12 changes: 12 additions & 0 deletions node_modules/.bin/acorn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/acorn.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions node_modules/.bin/acorn.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions node_modules/.bin/browserslist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/browserslist.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions node_modules/.bin/browserslist.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions node_modules/.bin/escodegen

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading