Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01.BonusScoringSystem
- {
- class Program
- {
- static void Main(string[] args)
- {
- int countOfStudents = int.Parse(Console.ReadLine());
- int countOfLectures = int.Parse(Console.ReadLine());
- int additionalBonus = int.Parse(Console.ReadLine());
- double maxBonus = 0;
- int attendedLectures = 0;
- for (int i = 0; i < countOfStudents; i++)
- {
- int studentAttendances = int.Parse(Console.ReadLine());
- double totalBonus = (double)studentAttendances / countOfLectures * (5 + additionalBonus);
- if (totalBonus > maxBonus)
- {
- maxBonus = totalBonus;
- attendedLectures = studentAttendances;
- }
- }
- Console.WriteLine($"Max Bonus: {Math.Ceiling(maxBonus)}.");
- Console.WriteLine($"The student has attended {attendedLectures} lectures.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement