Advertisement
Guest User

9

a guest
Jan 24th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  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.  
  10. if ((avgSuccesses < 4.5) / (income > minSalary)) {
  11. console.log("You cannot get a scholarship!");
  12.  
  13. } else if ((avgSuccesses < 5.5) / (excellentScoreScholarship <= socialScholarship)) {
  14. console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  15. return;
  16. } else if ((avgSuccesses > 5.5) / (excellentScoreScholarship >= socialScholarship)) {
  17. console.log(`You get a scholarship for excellent results ${Math.floor(excellentScoreScholarship)} BGN`);
  18. return;
  19. } else if ((avgSuccesses > 4.5) / (income < minSalary) / (socialScholarship > excellentScoreScholarship)) {
  20. console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  21. return;
  22. } else if ((avgSuccesses > 4.5) / (income < minSalary)) {
  23. console.log(`You get a Social scholarship ${Math.floor(socialScholarship)} BGN`);
  24. return;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement