Advertisement
Liliana797979

solarship

Jan 24th, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scholarShip(Input) {
  2.     let income = Number(Input[0]);
  3.     let averagesucces = Number(Input[1]);
  4.     let minsalary = Number(Input[2]);
  5.     let excelent = (averagesucces * 25);
  6.     let social = (minsalary * 0.35);
  7.     let ex = Math.floor(excelent);
  8.     let so = Math.floor(social);
  9.     if (averagesucces >= 5.50) {
  10.         if (social > excelent && income < minsalary) {
  11.             console.log(`You get a Social scholarship ${so} BGN`);
  12.         } else {
  13.             console.log(`You get a scholarship for excellent results ${ex} BGN`)
  14.         }
  15.  
  16.     } else if (averagesucces > 4.50 && averagesucces < 5.50) {
  17.         if (income < minsalary) {
  18.             console.log(`You get a Social scholarship ${so} BGN`);
  19.  
  20.         } else {
  21.             console.log(`You cannot get a scholarship!`);
  22.         }
  23.  
  24.     } else if (averagesucces <= 4.50) {
  25.         console.log(`You cannot get a scholarship!`);
  26.  
  27.     }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement