Anno unc e me nt Anno unc e me nt FIT100 FIT100 FIT100 No: Ye - - PowerPoint PPT Presentation

anno unc e me nt anno unc e me nt
SMART_READER_LITE
LIVE PREVIEW

Anno unc e me nt Anno unc e me nt FIT100 FIT100 FIT100 No: Ye - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Anno unc e me nt

FIT100 FIT100 FIT100

Anno unc e me nt

No:

  • Midte rms

Ye s:

  • L

a b s Midte rms

  • F

ina l L a b s

  • Quizze s

P j t

  • Pro je c ts
  • Quic k Write s
slide-2
SLIDE 2

FIT100 FIT100 FIT100

Pro je c t 2B

  • Pro je c t 2B a nd its “q uiz” a re linke d
  • 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!
slide-3
SLIDE 3

FIT100 FIT100 FIT100

Quiz a nd Quic k Write

  • Ne xt we e k

∗ Re vie w the

  • T
  • pic s will inc lude :
  • Va ria b le s

q ue stio ns a t the e nd o f the se c ha pte rs:

  • Va lue s & da ta

type s

  • Assig nme nt

c ha pte rs:

  • F

lue nc y c ha pte rs 18

a nd 20

  • Quic kS

tart c ha pte rs

sta te me nts

  • Rule s fo r ide ntifie rs
  • Co nditio na ls
  • Quic kS

tart c ha pte rs

1 a nd 2

  • All Ja va Sc ript!
  • L
  • o ps
  • Arra ys
  • F

unc tio ns

  • F

unc tio ns

  • Curly b ra c ke ts
slide-4
SLIDE 4

FIT100 FIT100 FIT100

CONT ROL F L OW

T hinking like a c o mpute r thinking like a human be ing….

CONT ROL F L OW

slide-5
SLIDE 5

FIT100 FIT100 FIT100

F itting it to g e the r…

  • 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

slide-6
SLIDE 6

FIT100 FIT100 FIT100

F itting it to g e the r…

  • An a lg o rithm is….

∗ A se t o f dire c tio ns

L e a ving L e c ture a lg orithm

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

  • Sta rt a t b e g inning
  • Co ntinue

Ga te s Ha ll 389 2. Pa c k up yo ur stuff 3. Pic k it up

  • Co ntinue
  • Until yo u re a c h the

e nd 4. Sta nd up 5. Wa lk to e nd o f a isle 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. Wa lk thro ug h do o rs 8. a

  • ug do o s
slide-7
SLIDE 7

FIT100 FIT100 FIT100

Co ntro l F lo w

  • 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….
slide-8
SLIDE 8

FIT100 FIT100 FIT100

F itting it to g e the r…

  • An a lg o rithm is….

∗ A se t o f dire c tio ns

L e a ving L e c ture a lg orithm

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

  • Sta rt a t b e g inning
  • Co ntinue

2. Pa c k up yo ur stuff 3. Pic k it up 4 Sta nd up Co ntinue

  • Until yo u re a c h the

e nd

∗ Co nditio na ls o r

4. Sta nd up 5. Wa lk to e nd o f a isle 6. Wa lk do wn ste ps until yo u h b tt f t

∗ Co nditio na ls, o r

te sts, c ha ng e the c o ntro l flo w

re a c h b o tto m o f ste ps 7. T urn le ft 8. Wa lk thro ug h do o rs

slide-9
SLIDE 9

FIT100 FIT100 FIT100

F itting it to g e the r…

  • An a lg o rithm is….

∗ A se t o f dire c tio ns

L e a ving L e c ture a lg orithm

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

  • Sta rt a t b e g inning
  • Co ntinue

2. Pa c k up yo ur stuff 3. Pic k it up 4 Sta nd up Co ntinue

  • Until yo u re a c h the

e nd

∗ Cha ng e the

4. Sta nd up 5. Wa lk to e nd o f a isle 6. Wa lk do wn ste ps until yo u h b tt f t

∗ Cha ng e the

c o ntro l flo w with

  • Co nditio na ls, o r

re a c h b o tto m o f ste ps 7. T urn le ft 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

slide-10
SLIDE 10

FIT100 FIT100 FIT100

F itting it to g e the r…

  • An a lg o rithm is….

∗ A se t o f dire c tio ns

L e a ving L e c ture a lg orithm

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

  • Sta rt a t b e g inning
  • Co ntinue

2. Pa c k up yo ur stuff 3. Pic k it up 4 Sta nd up Co ntinue

  • Until yo u re a c h the

e nd

∗ Cha ng e the

4. Sta nd up 5. Wa lk to e nd o f a isle 6. L

  • o p:

1 W lk d 1 t t ti til

∗ Cha ng e the

c o ntro l flo w with

  • Co nditio na ls, o r

1. Wa lk do wn 1 ste p a t a time until yo u re a c h the b o tto m

7. T urn le ft 8. T e st: I s do o r o pe n? te sts

  • I

te ra tio n, o r lo o ps 8. T e st: I s do o r o pe n?

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

slide-11
SLIDE 11

FIT100 FIT100 FIT100

F itting it to g e the r…

  • An a lg o rithm is….

∗ A se t o f dire c tio ns

L e a ving L e c ture a lg orithm

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

  • Sta rt a t b e g inning
  • Co ntinue

2. T e st: Any stuff o ut?

1. T rue : Pa c k up yo ur stuff

3. Pic k it up Co ntinue

  • Until yo u re a c h the

e nd

∗ Cha ng e the

p 4. Sta nd up 5. Wa lk to e nd o f a isle 6 L

  • o p:

∗ Cha ng e the

c o ntro l flo w with

  • Co nditio na ls, o r

6. L

  • o p:

1. Wa lk do wn 1 ste p a t a time until yo u re a c h the b o tto m

7. T urn le ft te sts

  • I

te ra tio n, o r lo o ps 8. T e st: I s do o r o pe n?

1. T rue : Wa lk thro ug h do o rs 2. F a lse : Ope n do o r, the n wa lk thro ug h

slide-12
SLIDE 12

FIT100 FIT100 FIT100

MORE F ORMS

Mo ving the data o n the fo rm…

MORE F ORMS

slide-13
SLIDE 13

FIT100 FIT100 FIT100

E ve nts Ca use Pro c e ssing

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

ve nt type s

I n the <input > ta g a n

∗ E

ve nt type s

  • o nClic k
  • o nCha ng e

I n the <input …> ta g , a n e ve nt ha ndle r g ive s the pro c e ssing ne e de d fo r th t k i J S i t

  • nCha ng e
  • o nMo use Ove r

the ta sk using Ja va Sc ript

slide-14
SLIDE 14

FIT100 FIT100 FIT100

De mo nstra tio n

  • Smile ys…
slide-15
SLIDE 15

FIT100 FIT100 FIT100

Asia n E mo tic o ns

(^_^) L a ug hing (>_<)> T ro ub le d (? ? ? )/ Jo yful (? ? ? ;) Surprise d ( ) (^_^;) T ro ub le d (T

  • T

) Crying ( ) p (# ^.^# ) Shy (*´? `*) I nfa tua tio n ( ) C y g m(_ _)m Apo lo g ising (^^;) Shy ( ) (? ? ;) Wo rrie d (*^? ^*) Jo yful ( ;) Shy (? ? ? ) Grinning ( ? ) Jo yful (^? ^) L a ug hing

Rig htside up

slide-16
SLIDE 16

FIT100 FIT100 FIT100

E mo tic o ns = E mo tio na l I c o ns

:-) Smile o r Ha ppy :-( F ro wn o r Sa d :-p “Ra spb e rry" o r 'to ng ue in c he e k’ ;-) Winking :-D L a ug hte r : C Ve r e r sa d :-S Co nfuse d :-/ Do ub tful o r c o nf se d :-C Ve ry, ve ry sa d D-: Anno ye d, sho c ke d

  • r sc a re d

c o nfuse d :-| Bla nk O:O O Surprise d o r O:O_O Surprise d o r sho c ke d

slide-17
SLIDE 17

FIT100 FIT100 FIT100

Ob se rve Ac tio ns

slide-18
SLIDE 18

FIT100 FIT100 FIT100

‘ o nClic k’ E ve nt fo r Butto ns

<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>

∗ E

ve nt ha ndle rs sa y wha t t d if t h

p yp ...

to do if e ve nt ha ppe ns … “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

slide-19
SLIDE 19

FIT100 FIT100 FIT100

‘ o nClic k’ fo r Butto ns

<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>

∗ No tic e …

p yp ...

  • ‘ 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

slide-20
SLIDE 20

FIT100 FIT100 FIT100

x.va lue

<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>

∗ No tic e …

p yp ...

  • the value o f a te xtb o x

is the c o nte nts

  • f the te xtb o x

textbox

  • f the te xtb o x

x.value name

slide-21
SLIDE 21

FIT100 FIT100 FIT100

PASSING VAL UE S T O

Ge tting the data to the func tio ns…

PASSING VAL UE S T O F UNCT IONS

slide-22
SLIDE 22

FIT100 FIT100 FIT100

F unc tio ns

Head

func tio n a ddI t(x, y) { va r x, y; re turn x+y; y; }

Body

Re sult = a ddI t(6, 7);