Challenge: Counting Elements
Task
Swipe to start coding
- Initialize
numberOfFruits
with the length of thefruitBasket
array. - If
numberOfFruits
has 3 or fewer fruits, print:"We have a small fruit basket with [number] fruits!"
, where[number]
should be the number of fruits. - If
numberOfFruits
has more than 3 fruits, print:"We have a big fruit basket with [number] fruits!"
.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 9
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.33
Challenge: Counting Elements
Swipe to show menu
Task
Swipe to start coding
- Initialize
numberOfFruits
with the length of thefruitBasket
array. - If
numberOfFruits
has 3 or fewer fruits, print:"We have a small fruit basket with [number] fruits!"
, where[number]
should be the number of fruits. - If
numberOfFruits
has more than 3 fruits, print:"We have a big fruit basket with [number] fruits!"
.
Solution
Everything was clear?
Thanks for your feedback!
Awesome!
Completion rate improved to 1.33SectionΒ 5. ChapterΒ 9
single