Advertisement
Guest User

Scholarship

a guest
Nov 29th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. function Scholarship(input) {
  2. let dohod = Number(input.shift());
  3. let avGrade = Number(input.shift());
  4. let minZapl = Number(input.shift());
  5. let socScholarship = 0;
  6. let gradeScholarship = 0;
  7. if (dohod < minZapl) {
  8. if (avGrade > 4.5) {
  9. socScholarship = minZapl * 0.35;
  10. }
  11. }
  12. if (avGrade >= 5.50) {
  13. gradeScholarship = avGrade * 25;
  14. }
  15. if (socScholarship > gradeScholarship) {
  16. console.log(`You get a Social scholarship ${Math.floor(socScholarship)} BGN`);
  17. }
  18. else if (gradeScholarship > socScholarship) {
  19. console.log(`You get a scholarship for excellent results ${Math.floor(gradeScholarship)} BGN`);
  20. }
  21. else {
  22. console.log(`You cannot get a scholarship!`);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement