Guest User

Untitled

a guest
Jan 22nd, 2020
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function schoolScholarship(input){
  2. let profit = Number(input.shift());
  3. let averageGrade = Number(input.shift());
  4. let minSalary = Number(input.shift());
  5.  
  6. let socialSch = minSalary*(35/100);
  7. let excellentSch = averageGrade*25;
  8.  
  9. if (averageGrade >= 5.50 && profit < minSalary) {
  10. if (socialSch > excellentSch) {
  11. console.log(`You get a Social scholarship ${Math.floor(socialSch)} BGN`);
  12. } else {
  13. console.log(`You get a scholarship for excellent results ${Math.floor(excellentSch)} BGN`);
  14. }
  15. } else if (averageGrade >= 5.50 && profit >= minSalary) {
  16. console.log(`You get a scholarship for excellent results ${Math.floor(excellentSch)} BGN`);
  17. } else if (averageGrade > 4.50 && profit < minSalary) {
  18. console.log(`You get a Social scholarship ${Math.floor(socialSch)} BGN`);
  19. } else {
  20. console.log("You cannot get a scholarship!");
  21. }
  22. }
  23.  
  24. schoolScholarship([100.00, 5.65, 420.00]);
RAW Paste Data