Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function scholarship(input) {
- let income = Number(input[0]);
- let avgGrade = Number(input[1]);
- let minSalary = Number(input[2]);
- let socialScholarship = minSalary * 0.35;
- let excScholarship = avgGrade * 25;
- if (avgGrade >= 5.50)
- if (income >= minSalary || excScholarship >= socialScholarship) {
- console.log(`You get a scholarship for excellent results ${Math.floor(excScholarship)} BGN`);
- } else {
- console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
- } else if (income <= minSalary && avgGrade >= 4.50) {
- console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
- } else {
- console.log("You cannot get a scholarship!");
- }
- }
- scholarship(["600.00", "6.00", "400.00"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement