Title: Raptor ?????
1Raptor ?????
2Raptor???????
- ??????(Visual Programming Tool)
- ??????(Flowchart Interrupter)
- Raptor???????(???????)
- http//raptor.martincarlisle.com/
3???????????
- ??????????????????????
- ?????????
- ???????????/?????
- ???20??????????????? ?????????????
4Raptor????????
- ????
- ??????????????,????????????,????????????????
- ??
- ?????????????????
- ??????
- ????????, Raptor??????(Syntax/Grammer)??
- ????
- ????(User-friendly)
- ????????(Project)???
- ?????????????(Program)????(Readability)
5Raptor??????
??????
?? ????
????
6????????
- http//minisite.proj.hkedcity.net/sec-te/cht/topic
s/prog_raptor/index.html
7??Raptor????????????
- ?????????,???????????
- ??????????????
- ?????????
- ???????????
- ???????????
8Raptor????(??)
9???????
- Raptor????????(Directed Graph)
- ?????Start???End?
- ?????Start???, ????End????
- ??Start???End?????????, ?????????????
????????????
??????????????
?????????????
10?????(Variables)?
- ??????????????
- ?????????????
- ?????,?????????
11??(Variables)
- ????,????????, ???????
- ????????????(initializing a variable)
- ???????????,?????????(Runtime Error)
- ?????????
- ????
- ????
- ?????????, ???????????
- ?????????, ???????????
12??(Variables)
- ???????????
- ????
- ???????????
- ???????????????????,?????????????
- ?Hello, send2you, it_a_nice_day
- ?2myfriend, iamveryangry!
- ?????????????(Reserved word)??
- ???????
- ?????? (e.g. a, exam_mark)
- ?????? (e.g. Average, Avg)
13?????(Constant)?
- ?????,??????????
- ??pi, e, true, false, yes, no
- pi ?? 3.14159274101257.
- e ?? 2.71828174591064.
- True ? Yes ?? 1.
- False ? No ?? 0.
14???!
- ?????????? (L)legal,?????? (I)Illegal?????,??????
- 1) U_2
- 2) Money
- 3) Thisisaveryveryveryveryverylongname
- 4) Mickey-Mouse
- 5) 365_Days
- 6) Begin
- 7) End_Of_Data
- 8) Procedure
- 9) Is This Identifier Legal
- 10) Why_Isnt_This_One_Legal
- ?RAPTOR??????,?????????,?????????????(True/ False)
15???!
- ???? x ????????
- ? x?x2 ????x?x/3, x ????????
- ?? x?32 ??variable?32, ???????
16??(Statement)
- ??(Statement)???
- ?????????????????,????????????
- Raptor??6???
- ???? (Sequential structure)
- Input,
- Output,
- Assignment,
- Call,
- ???? (Control structure)
- Selection
- Loop
17???
- ??????
- Assignment
- Loop
- Input
- Output
18???
- ??????
- Input
- Call
- Selection
19????Input Statement
- ???????
- ????
- ?????????????
- ???????,??????
- ?????(prompt)??
- ???????,?????????
- Input Text(????)
- Input Expression(????)
- ??Enter a number between low and
high
20????Output Statement
?????
21???!
- ??????,???1234,???1234,????????????
- ??????????,?????????
- ??????????????????
- ??????????????,????????Hello, John. Nice to
meet you! I like running too!
22??Assignment
- Assignment ???
- ?????????
- Expression(??) ???
- ??????????????????,????????????
- Assigment ???(Syntax)
- ltVariablegt ? ltExpressiongt ? Set ltVariablegt to
ltExpressiongt - lt????gt ? lt??gt ? Set lt????gt to lt??gt
- ??
- Cost ? (Tax_Rate Non_Food_Total) Food_Total
- ?? ? (?? ?????) ????
?? Variable being assigned (????????)
? Assignment Symbol (????)
(?? ?????) ???? Expression to be evaluated and assigned during run time (????????????????)
23???Operator
- ????
- Bulit in Operator
- E.g. X/3, Y7
- Function/Method (??/??)
- E.g. sqrt(4.7), sin(2.9)
- Relational Operator, Logical Operator ???
Selection? Loop?? - Relational Operator??????(T/F)?, ?Logical
Operator???????
basic math (????) , -, , /, , , rem, mod, sqrt, log, abs, ceiling, floor
Trigonometry (???) sin, cos, tan, cot, arcsin, arcos, arctan, arccot
Relational (???) , !, /, lt, gt, gt, lt
Logical (??) and, or, not
Miscellaneous (??) random, Length_of
24???!
- ?????????
- 1) 46 / 2
- 2) 46 / 3
- 3) 46 rem 3
- 4) 46 2
- 5) 12 lt 13
- 6) 35 gt 90
- 7) 120 / 602
- 8) 46 lt 49.5
- 9) True and False
- 10) (False and False) or True
- 11) (45.6 lt 32.4) or (14 lt 28)
- 12) 8 lt 10 lt 20
- 13) True and 7
- 14) 44 lt 121.456
- 15) 77 -1128
- ????????
- (A) Arithmetic operators?????, (L)
Logical?????, ?? (R) relational operators?????. - 1) !
- 2)
- 3) /
- 4) not
25????Procedure Call statements
- Procedure??????,???????(Task)
- ????????,???????,??????????????
- ????????????????(Data)
26??
27??Comments
- ?????????????????????????,?????????????????
- ?????????????,??????????????
- ???????
- ????????,???????? Comment ????
28???!
- ?????????????????,???????,????????????????
- ???????????????????
- ?????????????(??????????)
29????Control Structure
- Sequential Structure(????)
- ?????,????
- Selection Structure(????)
- ?????,????
- ??????True?False
- ??????,60???,?????????,????????
30????Logic Table
And Table
Or Table
Expression Result
True and True True
True and False False
False and True False
False and False False
Expression Result
True Or True True
True Or False True
False Or True True
False Or False False
Not Table
- ??
- ????8?,????????40,?????
- ???????,?????????,??????????,????
Expression Result
Not(True) False
Not(False) True
31???? Control Structure
32????Control Structure
33????Control Structure
34???!
- ????????????Always True ??(A),
Always False ??(B), Good ??(C) - GR_Score gt 100 or GR_Score lt 90. GR_Score gt
100 and GR_Score lt 90. GR_Score lt 100 or
GR_Score gt 90. GR_Score lt 100 and GR_Score gt
90.
35???!
- ???????,??X??????1, 2, ?3,????????? ONE, TWO,
or THREE - ???????,????????(Fahrenheit)?????(Celsius)???????
???????? (F to C ? C to F),????????,??????????????
? - C to F F 9/5 C 32
- F to C C 5/9 (F 32)
36????Iteration Control
- ????????????????????????
- ????,???????????????
- ?????????
- ???????????????
- ????(Cascading Loop)
- ????(Infinite Loop)
- ????????No
- ????,?????????????????
37??
- ???????????????
- ?????
- ???????????
38???!
39??
40??
41??
42????????
- ??????????,???????Possible_Prime?
- ????????????? (Set Is_Prime to True)
- ??x?2? Possible_Prime-1
- a??x??Possible_Prime,
- b??x?Possible_Prime???
- c?????????? (Set Is_Prime to False)
- ?? Is_Prime is True,
- ??Possible_Prime?????
43- ??????????,???????Possible_Prime?
- ????????????? (Set Is_Prime to True)
- ??x?2? Possible_Prime-1
- a??x??Possible_Prime
- b??x?Possible_Prime???
- c?????????? (Set Is_Prime to False)
- ?? Is_Prime is True,
- ??Possible_Prime?????
44????????
- ??????Selection????Loop???,???????????
- ??????????????????? (Selection)
- ??????????????(?????)? (Selection)
- ??????????????? (Cascading Selection)
- ???????????? (loop)
- ???????????? (count-controlled-loop)
45??????
- ????????????????
- ?? Sequential, Selection, Iteration
???????,??????????? - ????????????????????
- ???????Selection?Iteration?????????????
- ?? Selection?iteration??????????
- ?? Selection????
- ?A???A,
- ?A?B
- ?A,B,C.???
- ?? Iteration????
- ??A??
- ?????,????????????????????
- ???????????,??????????,???????
46???!
- ?????????????? Sequential (A)Selection
(B1)Cascading Selection (B2), Loop (C) - - ???????????. - ????????????????. -
??????????. - ?????????,??????. -
????????????????0. - ?????????????????. -
?????????????? - ???????,??Odd?Even - - ??1?100?????? - ?????????,??????-1
47????
- http//raptor.martincarlisle.com/
- http//minisite.proj.hkedcity.net/sec-te/cht/TE/By
KC/IT/index.html