Overview: |
By the time students reach this lesson, they should already have plenty of practice using repeat loops, so now it's time to mix things up.
While loops are loops that continue to repeat commands while a condition is met. While loops are used when the programmer doesn't know the exact number of times commands need to be repeated but does know what condition needs to be true in order for the loop to continue repeating. For example, students will be working to fill holes and dig dirt in Farmer. They will not know the size of the holes or the height of the mountains of dirt, but the students will know they need to keep filling the holes and digging the dirt as long as the ground is not flat.
As your students continue to deepen their knowledge of loops, they will come across problems where a command needs to be repeated, but it is unknown how many times it needs to be repeated. This is where while loops come in. In today's lesson, students will develop a beginner's understanding of condition-based loops and also expand their knowledge of loops in general.
Students will be able to: - distinguish between loops that repeat a fixed number of times and loops that repeat as long as a condition is true. - use a while loop to create programs that can solve problems with unknown values.
Note: You will need to create a free account on code.org before you can view this resource. |
Content Standard(s): |
Digital Literacy and Computer Science DLIT (2018) Grade: 3 | 2) Analyze a given list of sub-problems while addressing a larger problem.
Example: Problem - making a peanut butter sandwich; sub-problem - opening jar, finding a knife, getting the bread.
Problem - design and share a brochure; sub-problem - selecting font, choosing layout. Unpacked Content
| Digital Literacy and Computer Science DLIT (2018) Grade: 3 | 5) Create an algorithm to solve a problem as a collaborative team.
Examples: Move a character/robot/person through a maze. List steps to build a sandwich. Unpacked Content
| Digital Literacy and Computer Science DLIT (2018) Grade: 3 | 7) Test and debug a given program in a block-based visual programming environment using arithmetic operators, conditionals, and repetition in programs, in collaboration with others.
Examples: Sequencing cards for unplugged activities, online coding practice. Unpacked Content
| Digital Literacy and Computer Science DLIT (2018) Grade: 3 | 23) Implement the design process to solve a simple problem.
Examples: Uneven table leg, noise in the cafeteria, tallying the collection of food drive donations. Unpacked Content
|
|
|