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