Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Choreography {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int Steps = Integer.parseInt(scanner.nextLine());
  8. int Dancers = Integer.parseInt(scanner.nextLine());
  9. int Days = Integer.parseInt(scanner.nextLine());
  10.  
  11. double StepsPerDayInPercent = (Steps / Days);
  12. double StepsInPersent = Math.ceil(StepsPerDayInPercent / Steps * 100);
  13. double DancerStepsInPersent = StepsInPersent / Dancers;
  14.  
  15. if (StepsInPersent < 13) {
  16. System.out.printf("Yes, they will succeed in that goal! %.2f%%.",DancerStepsInPersent);
  17.  
  18. } else
  19. System.out.printf("No, they will not succeed in that goal! Required %.2f%% steps to be learned per day.",DancerStepsInPersent);
  20.  
  21.  
  22. }
  23. }
  24.  
  25.  
  26. import java.util.Scanner;
  27.  
  28. public class Swimmers {
  29. public static void main(String[] args) {
  30. Scanner scanner = new Scanner(System.in);
  31.  
  32. double record = Double.parseDouble(scanner.nextLine());
  33. double distance = Double.parseDouble(scanner.nextLine());
  34. double secondsPerMeter = Double.parseDouble(scanner.nextLine());
  35.  
  36. double swimmingTime = distance * secondsPerMeter;
  37. double slowdown = Math.floor(distance / 15) * 12.5;
  38.  
  39. double TotalTime = swimmingTime + slowdown;
  40.  
  41. if (TotalTime < record) {
  42. System.out.printf("Yes, he succeeded! The new world record is %.2f seconds.", TotalTime);
  43. } else {
  44. double need = TotalTime - record;
  45. System.out.printf("No, he failed! He was %.2f seconds slower.", need);
  46.  
  47. }
  48.  
  49. }
  50. }
  51.  
  52.  
  53. import java.util.Scanner;
  54.  
  55. public class ThreeBrothers {
  56. public static void main(String[] args) {
  57. Scanner scanner = new Scanner(System.in);
  58.  
  59. double Brother1 = Double.parseDouble(scanner.nextLine());
  60. double Brother2 = Double.parseDouble(scanner.nextLine());
  61. double Brother3 = Double.parseDouble(scanner.nextLine());
  62. double FatherTime = Double.parseDouble(scanner.nextLine());
  63.  
  64. double TotalCleaningTime = (1 / (1 / Brother1 + 1 / Brother2 + 1 / Brother3)) * 1.15;
  65.  
  66. System.out.printf("Cleaning time: %.2f%n",TotalCleaningTime);
  67.  
  68. if (FatherTime > TotalCleaningTime) {
  69. System.out.printf("Yes, there is a surprise - time left -> %.0f hours.", Math.floor(FatherTime - TotalCleaningTime));
  70. } else {
  71. System.out.printf("No, there isn't a surprise - shortage of time -> %.0f hours.", Math.ceil(TotalCleaningTime - FatherTime));
  72. }
  73.  
  74.  
  75. }
  76. }
  77.  
  78. import java.util.Scanner;
  79.  
  80. public class Time15minutes {
  81. public static void main(String[] args) {
  82. Scanner scanner = new Scanner(System.in);
  83.  
  84. int Hours = Integer.parseInt(scanner.nextLine());
  85. int Minutes = Integer.parseInt(scanner.nextLine());
  86.  
  87. int HoursinMinutes = Hours * 60;
  88. int TotalTime = HoursinMinutes + Minutes + 15;
  89.  
  90. int HoursNew = TotalTime / 60;
  91. int MinutesNew = TotalTime % 60;
  92.  
  93. if (HoursNew == 24) {
  94. HoursNew = 0;
  95. }
  96.  
  97. if (MinutesNew < 10) {
  98. System.out.printf("%d:0%d", HoursNew, MinutesNew);
  99.  
  100. } else {
  101. System.out.printf("%d:%d", HoursNew, MinutesNew);
  102. }
  103.  
  104.  
  105. }
  106. }
  107.  
  108.  
  109.  
  110. import java.util.Scanner;
  111.  
  112. public class MetricConvertor {
  113.  
  114. public static void main(String[] args) {
  115. Scanner scanner = new Scanner(System.in);
  116.  
  117. double Number = Double.parseDouble(scanner.nextLine());
  118. String EntMetric = scanner.nextLine();
  119. String ExtMetric = scanner.nextLine();
  120.  
  121. if (EntMetric.equals("mm")) {
  122. Number /= 1000;
  123. } else if (EntMetric.equals("cm")) {
  124. Number /= 100;
  125. }
  126.  
  127. if (ExtMetric.equals("mm")) {
  128. Number *= 1000;
  129. } else if (ExtMetric.equals("cm")) {
  130. Number *= 100;
  131. }
  132. System.out.printf("%.3f",Number);
  133. }
  134. }
  135.  
  136. import java.util.Scanner;
  137.  
  138. public class SpeedInfo {
  139.  
  140. public static void main(String[] args) {
  141. Scanner scanner = new Scanner(System.in);
  142.  
  143. double speed = Double.parseDouble(scanner.nextLine());
  144.  
  145. if (speed <= 10) {
  146. System.out.println("slow");
  147. } else if (speed <= 50) {
  148. System.out.println("average");
  149. } else if (speed <= 150) {
  150. System.out.println("fast");
  151. } else if (speed <= 1000) {
  152. System.out.println("ultra fast");
  153. } else {
  154. System.out.println("extremely fast");
  155. }
  156.  
  157. }
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement