Untitled
unknown
plain_text
2 years ago
793 B
5
Indexable
import java.util.Scanner; public class Exercise6 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String actor = scanner.nextLine(); double points = Double.parseDouble(scanner.nextLine()); int evaluators = Integer.parseInt(scanner.nextLine()); for (int i = 0; i < evaluators; i++) { String evaluatorName = scanner.nextLine(); double pointsGiven = ((Double.parseDouble(scanner.nextLine()) * evaluatorName.length()) / 2); points+=pointsGiven; if (points > 1250.5) { System.out.printf("Congratulations, %s got a nominee for leading role with %.1f!", actor, points); break; } } if (points < 1250.5) { System.out.printf("Sorry, %s you need %.1f more!", actor, 1250.6 - points); } } }
Editor is loading...