Advertisement
Liliana797979

stipendii1

Jan 17th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scholarship(input) {
  2.  
  3.     let income = Number(input[0]);
  4.     let avgGrade = Number(input[1]);
  5.     let minSalary = Number(input[2]);
  6.  
  7.     let socialScholarship = minSalary * 0.35;
  8.     let excScholarship = avgGrade * 25;
  9.  
  10.     if (avgGrade >= 5.50)
  11.  
  12.         if (income >= minSalary || excScholarship >= socialScholarship) {
  13.             console.log(`You get a scholarship for excellent results ${Math.floor(excScholarship)} BGN`);
  14.  
  15.         } else {
  16.             console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  17.         } else if (income <= minSalary && avgGrade >= 4.50) {
  18.             console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  19.         } else {
  20.         console.log("You cannot get a scholarship!");
  21.     }
  22. }
  23. scholarship(["600.00", "6.00", "400.00"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement