Advertisement
Spocoman

Scholarship

Mar 15th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scholarship(inc, ave, sal) {
  2.     let income = Number(inc);
  3.     let average = Number(ave);
  4.     let salary = Number(sal);
  5.  
  6.     let social = Math.floor(salary * 0.35);
  7.     let excellent = Math.floor(average * 25);
  8.  
  9.     if (average >= 5.5) {
  10.         if (excellent >= social || income > salary) {
  11.             console.log(`You get a scholarship for excellent results ${excellent} BGN`);
  12.         } else {
  13.             console.log(`You get a Social scholarship ${social} BGN`);
  14.         }
  15.     } else if (average > 4.5 && average < 5.5 && income < salary) {
  16.             console.log(`You get a Social scholarship ${social} BGN`);
  17.     } else {
  18.         console.log("You cannot get a scholarship!");
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement