Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bonusScoringSystem(input) {
- let students = Number(input[0]);
- let lectures = Number(input[1]);
- let bonus = Number(input[2]);
- let attendances = [];
- for (let i = 3; i < students + 3; i++) {
- attendances.push(Number(input[i]));
- }
- console.log(`Max Bonus: ${(lectures > 0 ? Math.ceil(Math.max(...attendances) / lectures * (5 + bonus)) : 0)}.`);
- console.log(`The student has attended ${(attendances.length > 0 ? Math.max(...attendances) : 0)} lectures.`);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement