-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path08-scholarship.js
30 lines (25 loc) · 960 Bytes
/
08-scholarship.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
//08. Scholarship
function solve(income, avGrade, minSal) {
income = Number(income);
avGrade = Number(avGrade);
minSal = Number(minSal);
socialGrant = (0.35 * minSal);
scholarship = (avGrade * 25);
if (avGrade < 4.5) {
console.log("You cannot get a scholarship!")
}
if (avGrade < 5.5 && avGrade >= 4.5) {
if (income < minSal) {
console.log("You get a Social scholarship " + (Math.floor(socialGrant)) + " BGN");
} else if (income > minSal) {
console.log("You cannot get a scholarship!")
}
} else if (avGrade >= 5.5) {
if (scholarship > socialGrant) {
console.log("You get a scholarship for excellent results " + (Math.floor(scholarship)) + " BGN")
} else if (scholarship < socialGrant) {
console.log("You get a Social scholarship " + (Math.floor(socialGrant)) + " BGN");
}
}
}
solve("300.00", "5.65", "420.00")