Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function scholarship(input) {
- let incomeInLv = Number(input.shift());
- let avgSuccess = Number(input.shift());
- let minSalary = Number(input.shift());
- let schoShip1 = 0.0;
- let schoShip2 = 0.0;
- if (incomeInLv < minSalary && avgSuccess > 4.50) {
- schoShip1 = minSalary * 0.35;
- }
- if (avgSuccess >= 5.5) {
- schoShip2 = avgSuccess * 25;
- }
- if (schoShip1 > schoShip2) {
- console.log(`You get a Social scholarship ${Math.floor(schoShip1)} BGN`);
- } else if (schoShip2 > schoShip1) {
- console.log(`You get a scholarship for excellent results ${Math.floor(schoShip2)} BGN`);
- } else {
- console.log(`You cannot get a scholarship!`);
- }
- }
Add Comment
Please, Sign In to add comment