Advertisement
Guest User

Schoolarship

a guest
Jun 6th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function scholarship(input) {
  2.     let dohod = Number(input.shift());
  3.     let uspeh = Number(input.shift());
  4.     let minZaplata = Number(input.shift());
  5.     let pravoNaSoc = 0
  6.     let pravoZaUspeh = 0
  7.     if (dohod < minZaplata && uspeh > 4.50) {
  8.         pravoNaSoc = minZaplata * 0.35;
  9.     }
  10.     if (uspeh >= 5.5) {
  11.         pravoZaUspeh = uspeh * 25
  12.     }
  13.     if (pravoNaSoc > pravoZaUspeh) {
  14.         console.log(`You get a Social scholarship ${Math.floor(pravoNaSoc)} BGN`)
  15.     } else if (pravoZaUspeh > pravoNaSoc) {
  16.         console.log(`You get a scholarship for excellent results ${Math.floor(pravoZaUspeh)} BGN`)
  17.     } else
  18.         console.log("You cannot get a scholarship!")
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement