0
17.2 practice
function main() { var themNumber= 2 parseInt(readLine(), 10) /* 1 - Light 2 - Dark 3 - Nocturne 4 - Terminal 5 - Indigo */ // Your code here switch ("themeNumber2"){ case 1: console.log ("Light"); break; case 2: console.log ("Dark"); break; case 3: console.log ("Nocturne"); break; case 4: console.log ("Terminal"); break; case 5: console.log ("Indigo"); } }
4 Réponses
+ 2
var themNumber= 2 // this assigns 2
parseInt(readLine(), 10) // this will accept input but ingore next..
It must be like :
var themNumber = parseInt(readLine(), 10);
Next is :
switch ("themeNumber2"){ // passing string.. Incorrect.
Correct way is
switch( themeNumber ){ // passing variable value...
Hope it helps...
+ 1
I dont get it can you explain
+ 1
I got it !!! Thank you
0
I did give explanation only...
What you not understanding ?
2 mistakes you have and corrections you need is what I posted..