Anno unc e me nt Anno unc e me nt FIT100 FIT100 FIT100 No: Ye s: • Midte rms Midte rms • L L a b s a b s • F ina l • Quizze s • Pro je c ts P j t • Quic k Write s
Pro je c t 2B FIT100 FIT100 FIT100 • Pro je c t 2B a nd its “q uiz” a re linke d o n o ur o nline c a le nda r ∗ “Quiz” is • Ope n b o o k p • Sa ve a nd re sume • Re ta ke a s o fte n a s yo u wa nt to impro ve yo ur sc o re • Be sure to sub mit it b e fo re the q uiz c lo se s!
Quiz a nd Quic k Write FIT100 FIT100 FIT100 • Ne xt we e k • T o pic s will inc lude : ∗ Re vie w the • Va ria b le s • Va lue s & da ta q ue stio ns a t the type s e nd o f the se • Assig nme nt c ha pte rs: c ha pte rs: sta te me nts • F lue nc y c ha pte rs 18 • Rule s fo r ide ntifie rs a nd 20 • Co nditio na ls • Quic kS • Quic kS tart c ha pte rs tart c ha pte rs • L o o ps 1 a nd 2 • Arra ys • All Ja va Sc ript! • F • F unc tio ns unc tio ns • Curly b ra c ke ts
FIT100 FIT100 FIT100 T hinking like a c o mpute r thinking like a human be ing…. CONT CONT ROL ROL F F L L OW OW
F itting it to g e the r… FIT100 FIT100 FIT100 • An a lg o rithm is…. ∗ Write o ne se nte nc e o n a strip o f pa pe r Write o ne se nte nc e o n a strip o f pa pe r
F itting it to g e the r… FIT100 FIT100 FIT100 • An a lg o rithm is…. L e a ving L e c ture a lg orithm ∗ A se t o f dire c tio ns 1. Sta rt in yo ur se a t a t Ma ry Ga te s Ha ll 389 Ga te s Ha ll 389 ∗ L iste d se q ue ntia lly 2. Pa c k up yo ur stuff • Sta rt a t b e g inning 3. Pic k it up • Co ntinue • Co ntinue 4. Sta nd up • Until yo u re a c h the 5. Wa lk to e nd o f a isle e nd 6. Wa lk do wn ste ps until yo u re a c h b o tto m o f ste ps 7. T urn le ft 8. 8. Wa lk thro ug h do o rs a o ug do o s
Co ntro l F lo w FIT100 FIT100 FIT100 • Co ntro l flo w is the se q ue nc e thro ug h the c o de • Wha t we just lo o ke d a t wa s se que ntial flo w se que ntial flo w ∗ Sta rt a t ste p 1 c o ntinue thro ug h ste p 8 • No w we ’ ll lo o k a t o the rs • No w we ll lo o k a t o the rs….
F itting it to g e the r… FIT100 FIT100 FIT100 • An a lg o rithm is…. L e a ving L e c ture a lg orithm ∗ A se t o f dire c tio ns 1. Sta rt in yo ur se a t a t Ma ry Ga te s Ha ll 389 ∗ L iste d se q ue ntia lly 2. Pa c k up yo ur stuff • Sta rt a t b e g inning 3. Pic k it up • Co ntinue Co ntinue 4 4. Sta nd up Sta nd up • Until yo u re a c h the 5. Wa lk to e nd o f a isle e nd 6. Wa lk do wn ste ps until yo u ∗ Co nditio na ls o r ∗ Co nditio na ls, o r re a c h b o tto m o f ste ps h b tt f t te sts, c ha ng e the 7. T urn le ft c o ntro l flo w 8. Wa lk thro ug h do o rs
F itting it to g e the r… FIT100 FIT100 FIT100 • An a lg o rithm is…. L e a ving L e c ture a lg orithm ∗ A se t o f dire c tio ns 1. Sta rt in yo ur se a t a t Ma ry Ga te s Ha ll 389 ∗ L iste d se q ue ntia lly 2. Pa c k up yo ur stuff • Sta rt a t b e g inning 3. Pic k it up • Co ntinue Co ntinue 4 4. Sta nd up Sta nd up • Until yo u re a c h the 5. Wa lk to e nd o f a isle e nd 6. Wa lk do wn ste ps until yo u ∗ Cha ng e the ∗ Cha ng e the re a c h b o tto m o f ste ps h b tt f t c o ntro l flo w with 7. T urn le ft • Co nditio na ls, o r 8. T e st: I s do o r o pe n? te sts 1. Ye s: Wa lk thro ug h do o rs 2. No : Ope n do o r, the n wa lk thro ug h
F itting it to g e the r… FIT100 FIT100 FIT100 • An a lg o rithm is…. L e a ving L e c ture a lg orithm ∗ A se t o f dire c tio ns 1. Sta rt in yo ur se a t a t Ma ry Ga te s Ha ll 389 ∗ L iste d se q ue ntia lly 2. Pa c k up yo ur stuff • Sta rt a t b e g inning 3. Pic k it up • Co ntinue Co ntinue 4 4. Sta nd up Sta nd up • Until yo u re a c h the 5. Wa lk to e nd o f a isle e nd 6. L o o p: ∗ Cha ng e the ∗ Cha ng e the 1 1. W lk d Wa lk do wn 1 ste p a t a time until yo u 1 t t ti til re a c h the b o tto m c o ntro l flo w with 7. T urn le ft • Co nditio na ls, o r 8. 8. T T e st: I e st: I s do o r o pe n? s do o r o pe n? te sts 1. Ye s: Wa lk thro ug h do o rs 2. No : Ope n do o r, the n wa lk thro ug h • I te ra tio n, o r lo o ps
F itting it to g e the r… FIT100 FIT100 FIT100 • An a lg o rithm is…. L e a ving L e c ture a lg orithm ∗ A se t o f dire c tio ns 1. Sta rt in yo ur se a t a t Ma ry Ga te s Ha ll 389 ∗ L iste d se q ue ntia lly 2. T e st: Any stuff o ut? • Sta rt a t b e g inning 1. T rue : Pa c k up yo ur stuff 3. Pic k it up p • Co ntinue Co ntinue 4. Sta nd up • Until yo u re a c h the e nd 5. Wa lk to e nd o f a isle ∗ Cha ng e the ∗ Cha ng e the 6 6. L L o o p: o o p: 1. Wa lk do wn 1 ste p a t a time until yo u c o ntro l flo w with re a c h the b o tto m 7. T urn le ft • Co nditio na ls, o r te sts 8. T e st: I s do o r o pe n? 1. T rue : Wa lk thro ug h do o rs • I te ra tio n, o r lo o ps 2. F a lse : Ope n do o r, the n wa lk thro ug h
FIT100 FIT100 FIT100 Mo ving the data o n the fo rm… MORE MORE F F ORMS ORMS
E ve nts Ca use Pro c e ssing FIT100 FIT100 FIT100 Afte r dra wing a pa g e , b ro wse rs sit idle wa iting fo r so me thing to ha ppe n … g g pp whe n we g ive input, it c a use e ve nts • Pro c e ssing the input is the ta sk o f a n Pro c e ssing the input is the ta sk o f a n e ve nt handle r ∗ E ∗ E ve nt type s ve nt type s I I n the <input n the <input …> ta g , a n > ta g a n e ve nt ha ndle r g ive s the • o nClic k pro c e ssing ne e de d fo r • o nCha ng e o nCha ng e th t the ta sk using Ja va Sc ript k i J S i t • o nMo use Ove r
De mo nstra tio n • Smile ys… FIT100 FIT100 FIT100
Asia n E mo tic o ns FIT100 FIT100 FIT100 (^_^) L a ug hing (? ? ? )/ Jo yful ( (>_<)> T ) ro ub le d (? ? ? ;) ( ) Surprise d p (^_^;) T ro ub le d (# ^.^# ) Shy ( (* ´ ? `*) I ) nfa tua tio n ( (T o T ) ) Crying C y g m(_ _)m Apo lo g ising (? ? ;) Wo rrie d (^^;) Shy ( ;) Shy (*^? ^*) ( ? ) Jo yful Jo yful (? ? ? ) Grinning (^? ^) L a ug hing Rig htside up
E mo tic o ns = E mo tio na l I c o ns FIT100 FIT100 FIT100 :-) Smile o r Ha ppy :-p “Ra spb e rry" o r :-( F ro wn o r Sa d 'to ng ue in c he e k’ ;-) Winking :-S Co nfuse d :-D L a ug hte r :-/ Do ub tful o r :-C Ve ry, ve ry sa d : C Ve r e r sa d c o nf se d c o nfuse d D-: Anno ye d, sho c ke d :-| Bla nk o r sc a re d O:O O Surprise d o r O:O_O Surprise d o r sho c ke d
Ob se rve Ac tio ns FIT100 FIT100 FIT100
‘ o nClic k’ E ve nt fo r Butto ns FIT100 FIT100 FIT100 <h1>Emoticons </h1> <input type="button" value=" : -) " onClick="x.value='Smiley'"> <input type="button" value=" ; -) " onClick="x.value='Winky'"> input type button value ; ) onClick x.value Winky <input type="button" value=" : -( " onClick="x.value='Frowny'"> <input type="button" value="=8-O " onClick="x.value='Omagosh!'"> <input type="text" name=x size=8><br><br> p yp ... ∗ E ve nt ha ndle rs sa y wha t t d to do if e ve nt ha ppe ns … if t h “put ‘ Smile y’ in the o utput te xtb o x” te xtb o x E ve nt ha ndle rs = mini pro g ra ms
‘ o nClic k’ fo r Butto ns FIT100 FIT100 FIT100 <h1>Emoticons </h1> <input type="button" value=" : -) " onClick="x.value=' Smiley ‘ "> <input type="button" value=" ; -) " onClick="x.value='Winky'"> input type button value ; ) onClick x.value Winky <input type="button" value=" : -( " onClick="x.value='Frowny'"> <input type="button" value="=8-O " onClick="x.value='Omagosh!'"> <input type="text" name=x size=8><br><br> p yp ... ∗ No tic e … • ‘ onClick ’ e ve nt do e s the ta sk: pla c e s ‘ Smile y’ in the o utput te xtb o x in the o utput te xtb o x
x.va lue FIT100 FIT100 FIT100 <h1>Emoticons </h1> <input type="button" value=" : -) " onClick="x.value='Smiley'"> <input type="button" value=" ; -) " onClick=" x .value='Winky'"> input type button value ; ) onClick x .value Winky <input type="button" value=" : -( " onClick="x.value='Frowny'"> <input type="button" value="=8-O " onClick="x.value='Omagosh!'"> <input type="text" name=“ x ” size=“8”><br><br> p yp ... ∗ No tic e … • the value o f a te xtb o x is the c o nte nts textbox o f the te xtb o x o f the te xtb o x name x.value
FIT100 FIT100 FIT100 Ge tting the data to the func tio ns… PASSING VAL PASSING VAL UE UE S T S T O O F UNCT IONS
Recommend
More recommend