Advertisement
Guest User

Untitled

a guest
May 24th, 2019
153
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 score = Number(input[1]);
  4.     let salary = Number(input[2]);
  5.  
  6.     let social = 0;
  7.     let excellent = 0;
  8.  
  9.     if (income < salary && score > 4.50){
  10.         social = salary * 0.35;
  11.     }
  12.  
  13.     if (score >= 5.50){
  14.         excellent = score * 25;
  15.     }
  16.  
  17.     if ((social > excellent) && social != 0){
  18.         console.log(`You get a Social scholarship ${Math.floor(social)} BGN`)
  19.     }else if ((social <= excellent) && excellent != 0){
  20.         console.log(`You get a scholarship for excellent results ${Math.floor(excellent)} BGN`)
  21.     }else {
  22.         console.log(`You cannot get a scholarship!`)
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement