Advertisement
Lachezar

Untitled

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