Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Choreography {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int Steps = Integer.parseInt(scanner.nextLine());
- int Dancers = Integer.parseInt(scanner.nextLine());
- int Days = Integer.parseInt(scanner.nextLine());
- double StepsPerDayInPercent = (Steps / Days);
- double StepsInPersent = Math.ceil(StepsPerDayInPercent / Steps * 100);
- double DancerStepsInPersent = StepsInPersent / Dancers;
- if (StepsInPersent < 13) {
- System.out.printf("Yes, they will succeed in that goal! %.2f%%.",DancerStepsInPersent);
- } else
- System.out.printf("No, they will not succeed in that goal! Required %.2f%% steps to be learned per day.",DancerStepsInPersent);
- }
- }
- import java.util.Scanner;
- public class Swimmers {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double record = Double.parseDouble(scanner.nextLine());
- double distance = Double.parseDouble(scanner.nextLine());
- double secondsPerMeter = Double.parseDouble(scanner.nextLine());
- double swimmingTime = distance * secondsPerMeter;
- double slowdown = Math.floor(distance / 15) * 12.5;
- double TotalTime = swimmingTime + slowdown;
- if (TotalTime < record) {
- System.out.printf("Yes, he succeeded! The new world record is %.2f seconds.", TotalTime);
- } else {
- double need = TotalTime - record;
- System.out.printf("No, he failed! He was %.2f seconds slower.", need);
- }
- }
- }
- import java.util.Scanner;
- public class ThreeBrothers {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double Brother1 = Double.parseDouble(scanner.nextLine());
- double Brother2 = Double.parseDouble(scanner.nextLine());
- double Brother3 = Double.parseDouble(scanner.nextLine());
- double FatherTime = Double.parseDouble(scanner.nextLine());
- double TotalCleaningTime = (1 / (1 / Brother1 + 1 / Brother2 + 1 / Brother3)) * 1.15;
- System.out.printf("Cleaning time: %.2f%n",TotalCleaningTime);
- if (FatherTime > TotalCleaningTime) {
- System.out.printf("Yes, there is a surprise - time left -> %.0f hours.", Math.floor(FatherTime - TotalCleaningTime));
- } else {
- System.out.printf("No, there isn't a surprise - shortage of time -> %.0f hours.", Math.ceil(TotalCleaningTime - FatherTime));
- }
- }
- }
- import java.util.Scanner;
- public class Time15minutes {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int Hours = Integer.parseInt(scanner.nextLine());
- int Minutes = Integer.parseInt(scanner.nextLine());
- int HoursinMinutes = Hours * 60;
- int TotalTime = HoursinMinutes + Minutes + 15;
- int HoursNew = TotalTime / 60;
- int MinutesNew = TotalTime % 60;
- if (HoursNew == 24) {
- HoursNew = 0;
- }
- if (MinutesNew < 10) {
- System.out.printf("%d:0%d", HoursNew, MinutesNew);
- } else {
- System.out.printf("%d:%d", HoursNew, MinutesNew);
- }
- }
- }
- import java.util.Scanner;
- public class MetricConvertor {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double Number = Double.parseDouble(scanner.nextLine());
- String EntMetric = scanner.nextLine();
- String ExtMetric = scanner.nextLine();
- if (EntMetric.equals("mm")) {
- Number /= 1000;
- } else if (EntMetric.equals("cm")) {
- Number /= 100;
- }
- if (ExtMetric.equals("mm")) {
- Number *= 1000;
- } else if (ExtMetric.equals("cm")) {
- Number *= 100;
- }
- System.out.printf("%.3f",Number);
- }
- }
- import java.util.Scanner;
- public class SpeedInfo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double speed = Double.parseDouble(scanner.nextLine());
- if (speed <= 10) {
- System.out.println("slow");
- } else if (speed <= 50) {
- System.out.println("average");
- } else if (speed <= 150) {
- System.out.println("fast");
- } else if (speed <= 1000) {
- System.out.println("ultra fast");
- } else {
- System.out.println("extremely fast");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement