Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- java.util.Scanner scanner = new java.util.Scanner(System.in);
- String actorName = scanner.nextLine();
- double academyPoints = scanner.nextDouble();
- int reviewersCount = scanner.nextInt();
- String reviewerName = null;
- double reviewerRating = 0.0;
- for (int i = 1; i <= reviewersCount; i++) {
- reviewerName = scanner.next() + " " + scanner.next();
- reviewerRating = scanner.nextDouble();
- academyPoints = academyPoints + (reviewerName.length() * reviewerRating) / 2.0;
- if (academyPoints > 1250.5) {
- System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!",actorName,academyPoints);
- break;
- }
- }
- if (academyPoints < 1250.5) {
- System.out.printf("Sorry, %s you need %.1f more!", actorName, 1250.5 - academyPoints);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement