Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Exe4 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double sec = Double.parseDouble(scanner.nextLine());
- double meters = Double.parseDouble(scanner.nextLine());
- double met1seconds = Double.parseDouble(scanner.nextLine());
- double totalSec = meters * met1seconds;
- double slowing = meters / 15;
- double slow2 = slowing * 12.5;
- double Totaltime = totalSec + slow2;
- if (sec <= Totaltime) {
- double SS = Totaltime - sec;
- System.out.printf("No,he failed! He was %.2f",SS,"seconds slower.");
- } else {
- System.out.printf("Yes,he succeeded! The new world record is", Totaltime, "seconds slower.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement