Advertisement
Liliana797979

record

Dec 2nd, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function record(arg1, arg2, arg3) {
  2.     let recordInSeconds = Number(arg1);
  3.     let distanceInMetres = Number(arg2);
  4.     let timesInSeconds = Number(arg3);
  5.  
  6.     let totalResult = (distanceInMetres / recordInSeconds) * timesInSeconds;
  7.     totalTime = totalResult + recordInSeconds;
  8.  
  9.     if (totalResult > recordInSeconds) {
  10.         console.log(`Yes, he succeeded! The new world record is ${timesInSeconds} seconds.`);
  11.     } else {
  12.         console.log(`No, he failed! He was ${timesInSeconds} seconds slower.`);
  13.     }  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement