SHARE
TWEET

Untitled

a guest Jun 18th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Problem05 {
  4.     public static void main(String[] args){
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         String actorName = scanner.nextLine();
  8.         double pointsAcademy = Double.parseDouble(scanner.nextLine());
  9.         int judges = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double pointsCalculated = 0;
  12.         double pointsTotal = 0;
  13.         for (int i = 0; i < judges; i++) {
  14.             String judgeName = scanner.nextLine();
  15.             double pointsJudge = Double.parseDouble(scanner.nextLine());
  16.  
  17.             pointsCalculated = (judgeName.length() * pointsJudge) / 2;
  18.             pointsTotal = pointsCalculated + pointsAcademy;
  19.             pointsAcademy = pointsTotal;
  20.             if (pointsTotal > 1250.5) {
  21.                 break;
  22.             }
  23.         }
  24.  
  25.         if (pointsTotal > 1250.5) {
  26.             System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!", actorName, pointsTotal);
  27.         } else {
  28.             System.out.printf("Sorry, %s you need %.1f more!", actorName, (1250.5 - pointsTotal));
  29.         }
  30.     }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top