Challenge: Counting Elements
Tarefa
Swipe to start coding
You are given an array called fruitBasket that contains several fruit names.
- Create a variable named
numberOfFruitsand assign it the length of thefruitBasketarray. - Use an
if...elsestatement to:- Print
"We have a small fruit basket with [number] fruits!"if there are 3 or fewer fruits. - Print
"We have a big fruit basket with [number] fruits!"if there are more than 3 fruits.
- Print
- Make sure you use the
numberOfFruitsvariable in your console messages. Do not hardcode any numbers.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 64
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 1.33
Challenge: Counting Elements
Deslize para mostrar o menu
Tarefa
Swipe to start coding
You are given an array called fruitBasket that contains several fruit names.
- Create a variable named
numberOfFruitsand assign it the length of thefruitBasketarray. - Use an
if...elsestatement to:- Print
"We have a small fruit basket with [number] fruits!"if there are 3 or fewer fruits. - Print
"We have a big fruit basket with [number] fruits!"if there are more than 3 fruits.
- Print
- Make sure you use the
numberOfFruitsvariable in your console messages. Do not hardcode any numbers.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 64
single