function checksound(volume){
if (volume > 30)
sound = ‘loud’;
if (volume > 20)
sound = ‘good’;
if (volume > 0)
sound = ‘quiet’;
else sound = ‘no sound’;
return sound;
}
If the volume was entered as 31 would it return loud? I'm not sure as there is no else statement.
Aucun commentaire:
Enregistrer un commentaire