Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stipents(salary, avarege, minimumSalary) {
- salary = Number(salary);
- avarege = Number(avarege);
- minimumSalary = Number(minimumSalary);
- let socialStipend = 0;
- let excellentStipend = 0;
- if (salary <= minimumSalary && avarege >= 4.50) {
- socialStipend = minimumSalary * 0.35;
- }
- if (avarege >= 5.50) {
- excellentStipend = avarege * 25;
- }
- if (salary > minimumSalary && avarege < 5.50) {
- console.log('You cannot get a scholarship!');
- }
- else if (socialStipend > excellentStipend) {
- console.log(`You get a Social scholarship ${Math.floor(socialStipend)} BGN`);
- } else {
- console.log(`You get a scholarship for excellent results ${Math.floor(excellentStipend)} BGN`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement