Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.27 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class asd2 {
  4.     public static void main(String[] args) {
  5.                 Scanner scanner= new Scanner(System.in);
  6.                 double Stepdance = Double.parseDouble (scanner.nextLine());
  7.                 double CountDancer = Double.parseDouble (scanner.nextLine());
  8.                 double DayStudy = Double.parseDouble (scanner.nextLine());
  9.  
  10.                 double totalPStepsDay = ((Stepdance/DayStudy)/Stepdance)*100;
  11.                 double totalPerStepsDаncer = Math.ceil (totalPStepsDay) / CountDancer ; // Използвай Math.ceil за да закръглиш . Твоя код : double totalPerStepsDаncer = (totalPStepsDay/CountDancer)
  12.                 if(totalPStepsDay < 13){
  13.                     System.out.printf("Yes, they will succeed in that goal! %.2f%%.",totalPerStepsDаncer); // Твоя код : System.out.println("Yes, they will succeed in that goal! " + totalPerStepsDаncer +"%.");
  14.                 }
  15.                 else {
  16.                     System.out.printf("No, they will not succeed in that goal! Required %.2f%% steps to be learned per day. ",totalPerStepsDаncer); // Твоя код : System.out.printf("No, they will not succeed in that goal!,%.2f " + totalPerStepsDаncer+"%.");
  17.                 }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement