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