Advertisement
SIRAKOV4444

Untitled

Mar 26th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Exe4 {
  3. public static void main(String[] args) {
  4. Scanner scanner = new Scanner(System.in);
  5.  
  6. double sec = Double.parseDouble(scanner.nextLine());
  7. double meters = Double.parseDouble(scanner.nextLine());
  8. double met1seconds = Double.parseDouble(scanner.nextLine());
  9.  
  10. double totalSec = meters * met1seconds;
  11. double slowing = meters / 15;
  12. double slow2 = slowing * 12.5;
  13.  
  14. double Totaltime = totalSec + slow2;
  15.  
  16. if (sec <= Totaltime) {
  17. double SS = Totaltime - sec;
  18. System.out.printf("No,he failed! He was %.2f",SS,"seconds slower.");
  19. } else {
  20. System.out.printf("Yes,he succeeded! The new world record is", Totaltime, "seconds slower.");
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement