Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class test {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int studentsCount = Integer.parseInt(scanner.nextLine());
- int lecturesCount = Integer.parseInt(scanner.nextLine());
- int bonusInput = Integer.parseInt(scanner.nextLine());
- int mostAttendances = Integer.MIN_VALUE;
- for (int i = 1; i <= studentsCount; i++) {
- int attendanceInput = Integer.parseInt(scanner.nextLine());
- if (attendanceInput > mostAttendances) {
- mostAttendances = attendanceInput;
- }
- }
- double bonus = (mostAttendances * 1.0) / lecturesCount * (5 + bonusInput);
- System.out.printf("Max Bonus: %.0f.\n", Math.ceil(bonus));
- System.out.printf("The student has attended %d lectures.", mostAttendances);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement