SHARE
TWEET

Untitled

a guest May 26th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scholarships(input){
  2.     let income = Number(input.shift());
  3.     let averageResults = Number(input.shift());
  4.     let minSalary = Number(input.shift());
  5.     let socialScholarship = Math.floor(minSalary/100*35);
  6.     let academicScholarship = Math.floor(averageResults*25);
  7.     let socialMore = true;
  8.  
  9.     let socialScholarshipRight = true;
  10.     let academicScholarshipRight = true;
  11.  
  12.     if ((income>minSalary) || (averageResults<=4.5)){
  13.         socialScholarshipRight = !socialScholarshipRight;
  14.     }
  15.  
  16.     if (averageResults<5.5){
  17.         academicScholarshipRight = !academicScholarshipRight;
  18.     }
  19.  
  20.     if (socialScholarship<academicScholarship){
  21.         socialMore=false;
  22.     }
  23.  
  24.     if (socialScholarshipRight==false && academicScholarshipRight==false){
  25.         console.log("You cannot get a scholarship!");
  26.     } else if (socialScholarshipRight==true && socialMore==true){
  27.         console.log(`You get a Social scholarship ${socialScholarship} BGN`);
  28.     } else if (academicScholarshipRight==true && socialMore==false){
  29.         console.log(`You get a scholarship for excellent results ${academicScholarship} BGN`);
  30.     }
  31.  
  32. }
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