SHARE
TWEET

Untitled

kuhl Jan 21st, 2020 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function stipendii(input)
  2. {
  3.    let income = Number(input.shift());
  4.     let grade = Number(input.shift());
  5.     let minSalary = Number(input.shift());
  6.  
  7.     let socialScholarship = (0.35 * minSalary);
  8.     let gradeScholarship = (25 * grade);
  9.  
  10.     if (grade >= 5.50 && income < minSalary){
  11.         if (socialScholarship > gradeScholarship)
  12.         {
  13.             console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  14.         }
  15.         else
  16.         {
  17.             console.log(`You get a scholarship for excellent results ${Math.floor(gradeScholarship)} BGN`);
  18.         }
  19.     }
  20.     else if (grade >= 5.50 && income >= minSalary)
  21.     {
  22.         console.log(`You get a scholarship for excellent results ${Math.floor(gradeScholarship)} BGN`);
  23.     }
  24.     else if (grade > 4.50 && income < minSalary)
  25.     {
  26.         console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  27.     }
  28.     else if (grade <= 4.50 && income <= minSalary)
  29.     {
  30.         console.log(`You cannot get a scholarship!`);
  31.     }
  32.     else if (grade < 5.50 && income > minSalary)
  33.     {
  34.         console.log(`You cannot get a scholarship!`);
  35.     }
  36.    
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top