+ 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
5 Réponses
+ 2
BroFar Thanks sir.....
+ 1
Tried many times? Show your code, lemme see what's wrong there
+ 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");
}
+ 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 ..