Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bonusScore(input) {
- let num = Number(input[0]);
- let bonus = 0;
- if (num <= 100) {
- bonus = 5;
- } else if (num > 100) {
- bonus = bonus * 0.8;
- } else if (num >= 1000) {
- bonus = bonus * 0.9;
- }
- if (num % 2 === 0) {
- bonus = bonus + 1;
- } else if (num % 10 === 5) {
- bonus = bonus + 2;
- }
- console.log(bonus);
- console.log(num + bonus);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement