Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
  • Loading branch information
rmzn07-VSC committed Nov 27, 2024
0 parents commit 110e749
Show file tree
Hide file tree
Showing 19 changed files with 285 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arrayTanımKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let kisiler = ["Osman", "Ertuş" , "Kadir", "Hatice" , "Nazım", "Namık" , "Kemal" , "Sülo"];

console.log(kisiler[0]);
console.log(kisiler.length - 1);
console.log(kisiler[7]);
2 changes: 2 additions & 0 deletions arrowFunctionKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const sayHello = (name) => console.log("Hello, " + name);
sayHello("Osman");
15 changes: 15 additions & 0 deletions classKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Country{
constructor(name, year){
this.name=name;
this.year=year;
}

kutla(){
console.log(`${this.name}'mizin ${this.year}. yılı kutlu olsun!!`);


}}

const bilgi = new Country("Türkiye",101);

bilgi.kutla();
13 changes: 13 additions & 0 deletions diziDestructuring.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
console.log("Dizi Destructuring:");

const numbers = [1, 2, 3]; const [first, second, third] = numbers; console.log(first, second, third);

console.log("Obje Destructuring:");

const car = {
model:"1980",
marka:"BMW"
};

const{model,marka} = car;
console.log(model,marka);
5 changes: 5 additions & 0 deletions forKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
for (let i = 0; i < 10; i++){
console.log("Sayının karesi: " + (i**2));


}
6 changes: 6 additions & 0 deletions functionsKullanım.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function toplama(say1,say2){
console.log("Belirtilen iki sayının toplamı: " + (say1 + say2));

}

toplama(3,7);
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

<!DOCTYPE html>
<html>
<head>
<title>Benim Web Sayfam</title>
</head>
<body>

<script src="whileKullanim.js"></script>
</html>


31 changes: 31 additions & 0 deletions kitleIndex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var kilo = prompt("Lütfen kilonuzu giriniz:");
var boy = prompt("Lütfen boyunuzu giriniz:");

var boyIndex = boy*boy;
var kitleIndex = kilo/boyIndex;

if(kitleIndex >=45.0){
window.alert("Aşırı Obezsiniz... Kitle İndexiniz: " + kitleIndex);
}

else if (kitleIndex >= 30.0 && kitleIndex <= 44.9) {
window.alert("Obezsiniz... Kitle İndexiniz: " + kitleIndex);
}

else if (kitleIndex >= 25.0 && kitleIndex <= 29.9) {
window.alert("Fazla kilolusunuz... Kitle İndexiniz: " + kitleIndex);
}

else if (kitleIndex >= 18.5 && kitleIndex <= 24.9) {
window.alert(
"Normal kilodasınız, gayet sağlıklısınız :) Kitle İndexiniz: " + kitleIndex
);
}

else if (kitleIndex >= 8.5 && kitleIndex <= 18.4) {
window.alert("Zayıfsınız... Kitle İndexiniz: " + kitleIndex);
}

else if (kitleIndex <= 8.4) {
window.alert("Aşırı Zayıfsınız... Kitle İndexiniz: " + kitleIndex);
}
5 changes: 5 additions & 0 deletions letAndConstKullanimi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let a = 134;
console.log(a);
const b = 123;
b++; //Hata verdi
console.log(b);
6 changes: 6 additions & 0 deletions nestedLoopsKullanım.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
for(let carpilan = 0; carpilan <= 10; carpilan++){
for(let carpan = 0; carpan <= 10; carpan++){
let carpim = carpan*carpilan
console.log(carpilan + " * " + carpan + " = " + carpim);
}
}
13 changes: 13 additions & 0 deletions objectsKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
let game = {
name: "Minecraft",
popularity: "2 Billion Downloads",
startDate: 2009,
weSay:function(){
console.log("Best game is: " + this.name);
}
};

console.log(game.name);
console.log(game.popularity);
console.log(game.startDate);
game.weSay();
31 changes: 31 additions & 0 deletions petrolHesap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var yeniSatır = "\r\n";

var secim = parseFloat(
prompt(
"Hangi benzinden dolduracaksınız?" +yeniSatır+
"1- Dizel: Litresi 24.53 TL" +yeniSatır+
"2- Benzin: Litresi 22.25 TL" +yeniSatır+
"3- LPG: Litresi 11.1 TL"
)
);



var litre = prompt("Kaç litre (L) alacaksınız?");
var tutar = 0;

if (secim == 1) {
tutar = 24.53 * litre;

window.alert("Tutarnız: " + tutar);
} else if (secim == 2) {
tutar = 22.25 * litre;

window.alert("Tutarnız: " + tutar);
} else if (secim == 3) {
tutar = 11.1 * litre;

window.alert("Tutarnız: " + tutar);
} else {
window.alert("Geçerli bir değer giriniz!");
}
4 changes: 4 additions & 0 deletions restParameter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function sum(...numbers) {
return numbers.reduce((carpilan,carpim) => carpilan + carpim, -6);
}
console.log(sum(1,2,3));
9 changes: 9 additions & 0 deletions spreadOperator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const dizi1 = ['a','b','c','d'];
const dizi2 = ['e','f','g','h'];
const dizi1and2 = [...dizi1,...dizi2];
console.log(dizi1and2);

const nesne1 = {icerik1:12, icerik2:34};
const nesne2 = {icerik3:56, icerik4:78};
const nesne1and2 = {...nesne1,...nesne2}
console.log(nesne1and2);
20 changes: 20 additions & 0 deletions switchCase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

deger = Number(prompt("1, 2 veya 3 değerlerinden birini giriniz: "));


switch (deger) {
case 1:
alert("1 seçeneğini seçtiniz!");
break;
case 2:
alert("2 seçeneğini seçtiniz!");
break;
case 3:
alert("3 seçeneğini seçtiniz!");
break;
default:
alert("Geçerli bir değer giriniz!");


}

2 changes: 2 additions & 0 deletions templateLiteralsKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const sayHello = (name) => console.log(`Hello, ${name}`);
sayHello("Osman");
14 changes: 14 additions & 0 deletions typeConversionKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
debugger;

let a = 10;
let b = 20;

console.log(typeof a);
console.log(typeof b);
console.log(a.toString() + b.toString());

let c = String(20);
let d = String(30);
console.log(c + d);

console.log(parseInt(a) + parseInt(b) + parseInt(c) + parseInt(d));
69 changes: 69 additions & 0 deletions tytPuanHesap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
var turkDogru,
turkYanlis,
turkBos,
turkNet,
dogruDegerTurk,
yanlisDegerTurk,
sonHesapTurk,
turkGercekYanlis;
var matDogru,
matYanlis,
matBos,
matNet,
dogruDegerMat,
yanlisDegerMat,
sonHesapMat;
var sosDogru,
sosYanlis,
sosBos,
sosNet,
dogruDegerSos,
yanlisDegerSos,
sonHesapSos;
var fenDogru,
fenYanlis,
fenBos,
fenNet,
dogruDegerFen,
yanlisDegerFen,
sonHesapFen;

var turkToplamS = 40,
matToplamS = 40,
sosToplamS = 20,
fenToplamS = 20;

function getNet(dersAdi, toplamSoru) {
let dogru, yanlis, bos;
do {
dogru = parseInt(prompt(dersAdi + "den kaç doğrunuz var?"));
yanlis = parseInt(prompt(dersAdi + "den kaç yanlışınız var?"));
bos = parseInt(prompt(dersAdi + "den kaç boşunuz var?"));
let net = dogru - yanlis / 4;
if (net > toplamSoru || net < 0) {
alert(dersAdi + " için yanlış değer girdiniz! Lütfen tekrar deneyin.");
} else {
return net;
}
} while (true);
}

// Türkçe
sonHesapTurk = getNet("Türkçe", turkToplamS);
alert("Türkçe netiniz: " + sonHesapTurk);

// Matematik
sonHesapMat = getNet("Matematik", matToplamS);
alert("Matematik netiniz: " + sonHesapMat);

// Sosyal
sonHesapSos = getNet("Sosyal Bilgiler", sosToplamS);
alert("Sosyal Bilgiler netiniz: " + sonHesapSos);

// Fen
sonHesapFen = getNet("Fen Bilimleri", fenToplamS);
alert("Fen Bilimleri netiniz: " + sonHesapFen);

// Toplam Net
var toplamNet = sonHesapTurk + sonHesapMat + sonHesapSos + sonHesapFen;
alert("Toplam netiniz: " + toplamNet);
23 changes: 23 additions & 0 deletions whileKullanim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

let sum = 0;
let rety = 1;

while(rety <= 10){
sum = sum + rety;
rety++;
};
console.log("10 a kadar olan sayıların toplamı: " + sum);

let sayac = 1;

while(sayac <= 10){

console.log(sayac);

if(sayac == 8){
break;
}


sayac++
}

0 comments on commit 110e749

Please sign in to comment.