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();
- System.out.println(reviewerRating);
- System.out.println(reviewerName.length());
- academyPoints = academyPoints + ((reviewerName.length() * reviewerRating) / 2);
- }
- if (academyPoints > 1205.5) {
- System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!",actorName,academyPoints);
- } else {
- System.out.printf("Sorry, %s you need %.1f more!", actorName, 1205.5 - academyPoints);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement