SHARE
TWEET

9

a guest Jan 24th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scholarship(input) {
  2.     let income = Number(input.shift());
  3.     let avgSuccesses = Number(input.shift());
  4.     let minSalary = Number(input.shift());
  5.  
  6.     let socialScholarship = minSalary * 0.35;
  7.     let excellentScoreScholarship = avgSuccesses * 25;
  8.  
  9.     if ((avgSuccesses < 4.5) || (income > minSalary)) {
  10.         console.log("You cannot get a scholarship!");
  11.         return;
  12.     } else if ((avgSuccesses > 4.5) || (income < minSalary) , (socialScholarship > excellentScoreScholarship)) {
  13.         console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  14.         return;
  15.     } else if ((avgSuccesses > 5.5) ,(excellentScoreScholarship >= socialScholarship)) {
  16.         console.log(`You get a scholarship for excellent results ${Math.floor(excellentScoreScholarship)} BGN`);
  17.         return;
  18.     }
  19. }
  20.  
  21.  
  22.  
  23. scholarship([480.00, 4.60, 450.00]);
  24. scholarship([300.00, 5.65, 420.00]);
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