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