Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve (input){
  2.   let income = Number(input.shift());
  3.   let score = Number(input.shift());
  4.   let minSalary = Number(input.shift());
  5.   let socialScholarship = Math.floor(minSalary*0.35);
  6.   let excScholarship = Math.floor(score*25);
  7.  
  8.   if (score<5.5&&minSalary<income){
  9.     console.log("You cannot get a scholarship!");
  10.   } else if (score>=4.5&&score<5.5&&minSalary>=income){
  11.     console.log(`You get a Social scholarship ${socialScholarship} BGN`);
  12.   } else if (score>=5.5&&minSalary<income){
  13.     console.log(`You get a scholarship for excellent results ${excScholarship} BGN`);
  14.   } else if (score>=5.5&&minSalary>=income){
  15.       if (socialScholarship>excScholarship){
  16.         console.log(`You get a Social scholarship ${socialScholarship} BGN`);
  17.       } else {
  18.         console.log(`You get a scholarship for excellent results ${excScholarship} BGN`);
  19.       }
  20.   }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement