+ 1

Please help me solve this problem, I've tried many times but already get it wrong

The current world record for high jumping is 2.45 meters. You are given a program that receives as input a number that represents the height of the jump. Task Complete the code to: 1. output to the console "new record" if the number is more than 2.45, 2. output to the console "not this time" in other cases

27th Feb 2022, 5:14 AM
Collins Bawa
Collins Bawa - avatar
5 Réponses
+ 2
BroFar Thanks sir.....
27th Feb 2022, 5:58 AM
Collins Bawa
Collins Bawa - avatar
+ 1
Tried many times? Show your code, lemme see what's wrong there
27th Feb 2022, 5:25 AM
Rishi
Rishi - avatar
+ 1
var height = parseFloat(readLine(), 10) //your goes code here var met = 2.49; //var met = 2.45; if (met > 2.45){ console.log("new record"); } else { console.log("not this time"); }
27th Feb 2022, 5:37 AM
Collins Bawa
Collins Bawa - avatar
+ 1
Collins Bawa this should be all that you need. height = parseFloat(readLine(), 10) //your goes code here if (height > 2.45){ console.log("new record"); } else { console.log("not this time"); } not sure why you added the var met and then proceeded not to use it in place of the 2.45 but really don't need the extra variable as the number is a set value ..
27th Feb 2022, 5:42 AM
BroFar
BroFar - avatar