galinyotsev123

ProgBasics03Conditional-Statements-Y08Choreography

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