Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Oscars {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String name = scanner.nextLine();
- double pointsAcademy = Double.parseDouble(scanner.nextLine());
- int countAssess = Integer.parseInt(scanner.nextLine());
- boolean is1250 = false;
- for (int i = 1; i <= countAssess; i++) {
- String nameAssess = scanner.nextLine();
- double pointsAssess = Double.parseDouble(scanner.nextLine());
- pointsAcademy += nameAssess.length() * pointsAssess / 2;
- if (pointsAcademy >= 1250.50) {
- System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!", name, pointsAcademy);
- is1250 = true;
- break;
- }
- }
- if (!is1250) {
- System.out.printf("Sorry, %s you need %.1f more!",
- name, Math.abs(pointsAcademy - 1250.5));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement