Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function record(arg1, arg2, arg3) {
- let recordInSeconds = Number(arg1);
- let distanceInMetres = Number(arg2);
- let timesInSeconds = Number(arg3);
- let totalResult = (distanceInMetres / recordInSeconds) * timesInSeconds;
- totalTime = totalResult + recordInSeconds;
- if (totalResult > recordInSeconds) {
- console.log(`Yes, he succeeded! The new world record is ${timesInSeconds} seconds.`);
- } else {
- console.log(`No, he failed! He was ${timesInSeconds} seconds slower.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement