Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class OscarsPBexam4 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String actor = scanner.nextLine();
- double initialPoints = Double.parseDouble(scanner.nextLine());
- int juryAmount = Integer.parseInt(scanner.nextLine());
- while (juryAmount-- > 0) {
- String jury = scanner.nextLine();
- double givenPoints = Double.parseDouble(scanner.nextLine());
- double bonusPoints = jury.length();
- initialPoints += bonusPoints * givenPoints / 2;
- if (initialPoints > 1250.5) {
- System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!", actor, initialPoints);
- return;
- }
- }
- System.out.printf("Sorry, %s you need %.1f more!", actor, Math.abs(1250.5 - initialPoints));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement