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