Advertisement
teofarov13

Untitled

Mar 16th, 2021
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scholarship(input) {
  2.     let income = Number(input[0]);
  3.     let averageGrade = Number(input[1]);
  4.     let minSallary = Number(input[2]);
  5.  
  6.     let social = 0
  7.     let goodGrade = 0
  8.  
  9.     if (income < minSallary && averageGrade > 4.50 || social > goodGrade) {
  10.         social = minSallary * 0.35
  11.         console.log(`You get a Social scholarship ${Math.floor(social)} BGN`)
  12.     } else if (averageGrade >= 5.5) {
  13.         goodGrade = averageGrade * 25
  14.         console.log(`You get a scholarship for excellent results ${Math.floor(goodGrade)} BGN`)
  15.     } else {
  16.         console.log(`You cannot get a scholarship!`)
  17.     }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement