aneliabogeva

Scholarship

Jan 13th, 2021
682
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function squareArea(input){
  2.   let income = Number(input[0])
  3.   let avarageMarks  = Number(input[1])
  4.   let minSalary = Number(input[2])
  5.  
  6.   let socialMoney = Math.floor(0.35 * minSalary)
  7.   let schooMoney = Math.floor(25 * avarageMarks)
  8.  
  9.   if(income < minSalary){
  10.     if (avarageMarks >= 4.50 && avarageMarks < 5.50){
  11.       console.log(`You get a Social scholarship ${socialMoney} BGN`)
  12.     }else if(avarageMarks >= 4.50 && avarageMarks >= 5.50){
  13.       if(socialMoney > schooMoney){
  14.         console.log(`You get a Social scholarship ${socialMoney} BGN`)
  15.       }else if(socialMoney <= schooMoney){
  16.         console.log(`You get a scholarship for excellent results ${schooMoney} BGN`)
  17.       }
  18.     }else if(avarageMarks < 4.50){
  19.       console.log(`You cannot get a scholarship!`)
  20.     }
  21.   }else if(income >= minSalary){
  22.     if(avarageMarks >= 5.50){
  23.       console.log(`You get a scholarship for excellent results ${schooMoney} BGN`)
  24.     }else if(avarageMarks < 5.50){
  25.       console.log(`You cannot get a scholarship!`)
  26.     }
  27.   }
  28. }
  29.  
  30. squareArea(["480.00","4.60","450.00"]);
  31.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×