Advertisement
psi_mmobile

Untitled

May 12th, 2022
1,003
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. public class MyClass {
  2.     public static void main(String args[]) {
  3.         java.util.Scanner scanner = new java.util.Scanner(System.in);
  4.         String actorName = scanner.nextLine();
  5.         double academyPoints = scanner.nextDouble();
  6.         int reviewersCount = scanner.nextInt();
  7.         String reviewerName = null;
  8.         double reviewerRating = 0.0;
  9.         for (int i = 1; i <= reviewersCount; i++) {
  10.             reviewerName = scanner.next() + " " + scanner.next();
  11.             reviewerRating = scanner.nextDouble();
  12.             System.out.println(reviewerRating);
  13.             System.out.println(reviewerName.length());
  14.             academyPoints = academyPoints + ((reviewerName.length() * reviewerRating) / 2);
  15.         }
  16.         if (academyPoints > 1205.5) {
  17.             System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!",actorName,academyPoints);
  18.         } else {
  19.             System.out.printf("Sorry, %s you need %.1f more!", actorName, 1205.5 - academyPoints);
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement