dakata450

Untitled

Jun 29th, 2022
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. package forExersize;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Oscars {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8. String actor = scanner.nextLine();
  9.  
  10. double academyPoints = Double.parseDouble(scanner.nextLine());
  11. int n = Integer.parseInt(scanner.next());
  12.  
  13.  
  14. for (int i = 1; i <= n; i++) {
  15. String name = scanner.nextLine();
  16. double pointsJuri = Double.parseDouble(scanner.nextLine());
  17. int lenght = name.length();
  18.  
  19. academyPoints += academyPoints + (lenght * pointsJuri) / 2;
  20.  
  21.  
  22. }
  23. if(academyPoints > 1250.5 ){
  24. System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!", actor, academyPoints);
  25.  
  26. return;
  27.  
  28. }
  29. if(academyPoints < 1250.5){
  30. System.out.printf("Sorry, %s you need %.1f more!", actor, 1250.5 - academyPoints);
  31. }
  32.  
  33. }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment