Advertisement
dimoBs

08. Scholarship

Sep 20th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function money(income, averageSuccess, mrz) {
  2.     income = +income;
  3.     averageSuccess = +averageSuccess;
  4.     mrz = +mrz;
  5.  
  6.     let dohodSocial = 0;
  7.     let dohodSucces = 0;
  8.  
  9.     if (income < mrz && averageSuccess > 4.50) {
  10.         dohodSocial = Math.floor(mrz * 0.35);
  11.     }
  12.     if (averageSuccess >= 5.50) {
  13.         dohodSucces = Math.floor(averageSuccess * 0.25);
  14.     }
  15.     if (dohodSocial > dohodSucces && dohodSocial !==0 ) {
  16.         console.log(`You get a Social scholarship ${dohodSocial} BGN`);
  17.     } else if (dohodSucces >= dohodSocial && dohodSucces !==0) {
  18.         console.log(`You get a scholarship for excellent results ${dohodSucces} BGN`);
  19.     } else {
  20.     console.log("You cannot get a scholarship!");
  21.     }
  22.  
  23.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement