-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtytPuanHesap.js
69 lines (62 loc) · 1.51 KB
/
tytPuanHesap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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);