Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. Problem 1. Bonus Scoring System
  2. Create a program that calculates bonus points for each student, for a certain course. On the first line, you are going to receive the count of the students for this course. On the second line, you will receive the count of the lectures in the course. Every course has an additional bonus. You are going to receive it on the third line. On the next lines, you will be receiving the count of attendances for each student.
  3. The bonus is calculated with the following formula:
  4. {total bonus} = {student attendances} / {course lectures} * (5 + {additional bonus})
  5. Find the student with the maximum bonus and print him/her, along with his attendances in the following format:
  6. "Max Bonus: {maxBonusPoints}."
  7. "The student has attended {studentAttendances} lectures."
  8. Round the bonus points at the end to the nearest bigger number.
  9. Input / Constrains
  10. • On the first line you are going to receive the count of the students – an integer number in the range [0…50]
  11. • On the second line you are going to receive the count of the lectures – an integer number in the range [0...50].
  12. • On the third line you are going to receive the initial bonus – an integer number in the range [0….100].
  13. • On the next lines, you will be receiving the attendances of each student.
  14. • There will never be students with equal bonuses.
  15. Output
  16. • Print the maximum bonus points along with the attendances of the given student, rounded to the nearest bigger number, scored by a student in this course in the format described above.
  17. Examples
  18. Input Output
  19. 5
  20. 25
  21. 30
  22. 12
  23. 19
  24. 24
  25. 16
  26. 20 Max Bonus: 34.
  27. The student has attended 24 lectures.
  28. Comments
  29. First, we receive the number of students enrolled in the course – 5. The total count of the lectures is 25 and the initial bonus is 30. Then we calculate the bonus of the student with 12 attendances, which is 16.8. We continue calculating each of the student’s bonuses. The one with 24 attendances has the highest bonus – 33.6 (34 rounded), so we print the appropriate message on the console.
  30. 10
  31. 30
  32. 14
  33. 8
  34. 23
  35. 27
  36. 28
  37. 15
  38. 17
  39. 25
  40. 26
  41. 5
  42. 18 Max Bonus: 18.
  43. The student has attended 28 lectures.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement