Advertisement
kuhl

Untitled

Jan 21st, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement