Advertisement
Guest User

Untitled

a guest
Jan 20th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. function test(input) {
  2.  
  3. let income = Number(input[0]);
  4. let grade = Number(input[1]);
  5. let minSalary = Number(input[2]);
  6. let socialScholar = minSalary * 0.35;
  7. let gradeScholar = grade * 25;
  8.  
  9. if ((income < minSalary) && grade < 4.5) {
  10.  
  11. console.log('You cannot get a scholarship!');
  12. } else if ((income < minSalary) && grade > 4.5 && grade < 5.5) {
  13. console.log(`You get a Social scholarship ${Math.floor(socialScholar)} BGN`);
  14.  
  15. } else if ((income < minSalary) && grade >= 5.5) {
  16. gradeScholar >= socialScholar ? console.log(`You get a scholarship for excellent results ${Math.floor(gradeScholar)} BGN`) : console.log(`You get a Social scholarship ${Math.floor(socialScholar)} BGN`);
  17. } else if ((income >= minSalary) && grade >= 5.5) {
  18. console.log(`You get a scholarship for excellent results ${Math.floor(gradeScholar)} BGN`);
  19. }else if(income >= minSalary && grade < 5.5 ){
  20. console.log('You cannot get a scholarship!');
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement