Challenge: Searching for Animals in the Zoo
Tarea
Swipe to start coding
Use the includes method to check if certain animals are in a list.
- Write three
if-elseconditions to check if the following animals are in theanimalsInZooarray:Lion,Zebra,Panda. - If the animal is in the zoo, print:
"Yay! We have a [animal] in our zoo!", where[animal]is the name of the animal. - If the animal is not in the zoo, print:
"Oh no! No [animal] in our zoo today.".
As stated in the instructions, you will need three separate pairs of if-else conditions:
if(...) {
// code
} else {
// code
}
if(...) {
// code
} else {
// code
}
if(...) {
// code
} else {
// code
}
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 66
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Genial!
Completion tasa mejorada a 1.33
Challenge: Searching for Animals in the Zoo
Desliza para mostrar el menú
Tarea
Swipe to start coding
Use the includes method to check if certain animals are in a list.
- Write three
if-elseconditions to check if the following animals are in theanimalsInZooarray:Lion,Zebra,Panda. - If the animal is in the zoo, print:
"Yay! We have a [animal] in our zoo!", where[animal]is the name of the animal. - If the animal is not in the zoo, print:
"Oh no! No [animal] in our zoo today.".
As stated in the instructions, you will need three separate pairs of if-else conditions:
if(...) {
// code
} else {
// code
}
if(...) {
// code
} else {
// code
}
if(...) {
// code
} else {
// code
}
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 1. Capítulo 66
single