Advertisement
finderabc

Choreography

Jun 24th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P02_Choreography {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int countSteps = Integer.parseInt(scanner.nextLine());
  8.         int countDancers = Integer.parseInt(scanner.nextLine());
  9.         int countDays = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double dailySteps = (countSteps * 1.0 / countDays) / (countSteps);
  12.         double percentDailySteps = Math.ceil(dailySteps * 100);
  13.         double percentStepsDancer = percentDailySteps / countDancers;
  14.  
  15.         if (percentDailySteps <= 13) {
  16.             System.out.printf("Yes, they will succeed in that goal! %.2f%%.", percentStepsDancer);
  17.         } else {
  18.             System.out.printf("No, They will not succeed in that goal! Required %.2f%% steps to be learned per day.",
  19.                     percentStepsDancer);
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement