+ 4
Why isn't this working?
var score = prompt("Enter achieved score out of max. 100"); var grade = (score <50) ? "Failed":(score <60) ? "2":(score <70) ? "3":(score <80) ? "4":(score <90) ? "5":(score >90) ? "5+"; document.write("grade");
3 Answers
+ 6
var score = prompt("Enter achieved score out of max. 100");
var grade = score < 50 ? "Failed" : score < 60 ? "2" : score < 70 ? "3" : score < 80 ? "4" : score < 90 ? "5" : "5+"; // You don't need '(score >90) ?' here
document.write(grade); // remove quotes from grade
+ 2
thx dawg
0
thanks at list something that helps