Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function scholarship(input){
- let income = Number(input[0]);
- let grade = Number(input[1]);
- let salary = Number(input[2]);
- let social = salary * 0.35;
- let excellent = grade * 25;
- if (income < salary && grade <= 4.5){
- console.log('You cannot get a scholarship!');
- } else if (income < salary && grade < 5.5){
- console.log(`You get a Social scholarship ${Math.floor(social)} BGN`);
- } else if (income < salary && grade >= 5.5){
- excellent >= social ? console.log(`You get a scholarship for excellent results ${Math.floor(excellent)} BGN`) : console.log(`You get a Social scholarship ${Math.floor(social)} BGN`);
- } else if (income >= salary && grade >= 5.5){
- console.log(`You get a scholarship for excellent results ${Math.floor(excellent)} BGN`);
- } else if (income >= salary && grade < 5.5){
- console.log('You cannot get a scholarship!');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment