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