For Loop Lesson Plan

July 7, 2022 | Author: Anonymous | Category: N/A
Share Embed Donate


Short Description

Download For Loop Lesson Plan...

Description

 

The For Loop  The For Loop   by Emily Austin Austin Programming gI Course: Java Programmin Unit: Control St Structures II II Topic: The for loop: loop: single and nested Class Duration: 50 minut nutes th Grade Level: 10  1!th  Objective The students "ill be able to edit# save# com$ile and run a co com$uter m$uter $rogram "ritten in the  $rogramming language Java to code a solution using the %or loo$ construct& The students "ill also be able to do the same thing using nested %or loo$s& They "ill achieve these ob'ectives ob'ectives using (lueJ& Materials )esson Plan *hite board +ry erase mar,ers Com$uters "ith (lueJ *or,sheet *o r,sheet -1 .Java code that $rints out %ive ro"s o% asteris,s# asteris,s# ten "ide& The number o% the ro" is the %irst thing to be $rinted in the ro"# %ollo"ed by the asteris,s&/ Conversion Table Table Assignment Background This lesson assumes the level at "hich a student can read is at least euivalent to that o% a ty$ical 5 th  grade student& In order to be success%ul in this lesson# a student must have the %ollo"ing $rior ,no"ledge: use o% (lueJ# understanding o% e$ressions and statements# Strings# (oolean o$erators# and i%2else 3structure4& Procedures

1& Preassessment A& Short revie" o% e$ressions and statements (& Short revie" o% (oolean o$erators C& Pose the uestion: 3o" might you $rint out %ive ro"s o% asteris,s# ten "ide64 !& )ecture A& (asic for loop synta  for # $air o% $arentheses "ith se$arating semicolons# body o% loo$ surrounded by curly  brac,ets initiali7ation o% loo$ control variable test condition that controls loo$ entry • di%%erent "ays to to init8test i90 vs& i91 and i5 vs& i95 e$ression that .ho$e%ully/ alters the loo$ control variable (& (asic for (asic for loop logic loop logic 

 



 

  

 

Initiali7ation "ill al"ays eecute "hen a for a  for loop is loop is encountered& It only eecutes once& I% the test condition is true true## then the body o% the loo$ is entered& I% the test condition is false is false## then 3go to4 the line o% code that immediately %ollo"s the  for loop body& loop body& A%ter the body o% the for the for loop is loop is eecuted# the loo$ control variable is u$dated& )oo$ bac, to the test condition continuously until it is false is  false&&

C& S$ecial .or $it%alls/ Etracases semicolon in a statement  %or .int i90; i5; i
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF