Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Problem2 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int steps = Integer.parseInt(sc.nextLine());
- int dancers = Integer.parseInt(sc.nextLine());
- int daysToLearn =Integer.parseInt(sc.nextLine());
- double stepsPerDayPercent = (steps/daysToLearn);
- double Percent =(stepsPerDayPercent / steps) * 100;
- double rounded = Math.ceil(Percent);
- double percentDancer = rounded /dancers;
- if (rounded <= 13) {
- System.out.printf("%s %.2f%s", "Yes, they will succeed in that goal!",percentDancer,"%.");
- }
- else if (rounded>13) {
- System.out.printf("%s %.2f%s %s", "No, They will not succeed in that goal! Required",percentDancer, "%",
- "steps to be learned per day.");
- }
- // System.out.println(stepsPerDayPercent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement