Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package forExersize;
- import java.util.Scanner;
- public class Oscars {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String actor = scanner.nextLine();
- double academyPoints = Double.parseDouble(scanner.nextLine());
- int n = Integer.parseInt(scanner.next());
- for (int i = 1; i <= n; i++) {
- String name = scanner.nextLine();
- double pointsJuri = Double.parseDouble(scanner.nextLine());
- int lenght = name.length();
- academyPoints += academyPoints + (lenght * pointsJuri) / 2;
- }
- if(academyPoints > 1250.5 ){
- System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!", actor, academyPoints);
- return;
- }
- if(academyPoints < 1250.5){
- System.out.printf("Sorry, %s you need %.1f more!", actor, 1250.5 - academyPoints);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment