aboutsummaryrefslogtreecommitdiff
path: root/projects/10/ArrayTest/Main.xml
diff options
context:
space:
mode:
authorYuchen Pei <me@ypei.me>2018-01-20 15:41:49 +0100
committerYuchen Pei <me@ypei.me>2018-01-20 15:41:49 +0100
commitd3a0cc3a8ba6dfeb64d3faeffdeb6845b60e5840 (patch)
treed58df9ec2480e2a9ec6240f9c797f83d1a0b1056 /projects/10/ArrayTest/Main.xml
parent3571f998b28fbc8d9250ba04c983935f10a16c15 (diff)
rearranged the dir for github
- removed tools and pdfs - rearranged the projects dirs - added md files - other minor changes
Diffstat (limited to 'projects/10/ArrayTest/Main.xml')
-rw-r--r--projects/10/ArrayTest/Main.xml286
1 files changed, 0 insertions, 286 deletions
diff --git a/projects/10/ArrayTest/Main.xml b/projects/10/ArrayTest/Main.xml
deleted file mode 100644
index 0ea96df..0000000
--- a/projects/10/ArrayTest/Main.xml
+++ /dev/null
@@ -1,286 +0,0 @@
-<class>
- <keyword> class </keyword>
- <identifier> Main </identifier>
- <symbol> { </symbol>
- <subroutineDec>
- <keyword> function </keyword>
- <keyword> void </keyword>
- <identifier> main </identifier>
- <symbol> ( </symbol>
- <parameterList>
- </parameterList>
- <symbol> ) </symbol>
- <subroutineBody>
- <symbol> { </symbol>
- <varDec>
- <keyword> var </keyword>
- <identifier> Array </identifier>
- <identifier> a </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <keyword> int </keyword>
- <identifier> length </identifier>
- <symbol> ; </symbol>
- </varDec>
- <varDec>
- <keyword> var </keyword>
- <keyword> int </keyword>
- <identifier> i </identifier>
- <symbol> , </symbol>
- <identifier> sum </identifier>
- <symbol> ; </symbol>
- </varDec>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> length </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Keyboard </identifier>
- <symbol> . </symbol>
- <identifier> readInt </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <stringConstant> HOW MANY NUMBERS? </stringConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> a </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Array </identifier>
- <symbol> . </symbol>
- <identifier> new </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> a </identifier>
- <symbol> [ </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ] </symbol>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> Keyboard </identifier>
- <symbol> . </symbol>
- <identifier> readInt </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <stringConstant> ENTER THE NEXT NUMBER: </stringConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> sum </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <integerConstant> 0 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <whileStatement>
- <keyword> while </keyword>
- <symbol> ( </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> &lt; </symbol>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- <symbol> ) </symbol>
- <symbol> { </symbol>
- <statements>
- <letStatement>
- <keyword> let </keyword>
- <identifier> sum </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> sum </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <identifier> a </identifier>
- <symbol> [ </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- </expression>
- <symbol> ] </symbol>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- <letStatement>
- <keyword> let </keyword>
- <identifier> i </identifier>
- <symbol> = </symbol>
- <expression>
- <term>
- <identifier> i </identifier>
- </term>
- <symbol> + </symbol>
- <term>
- <integerConstant> 1 </integerConstant>
- </term>
- </expression>
- <symbol> ; </symbol>
- </letStatement>
- </statements>
- <symbol> } </symbol>
- </whileStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Output </identifier>
- <symbol> . </symbol>
- <identifier> printString </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <stringConstant> THE AVERAGE IS: </stringConstant>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Output </identifier>
- <symbol> . </symbol>
- <identifier> printInt </identifier>
- <symbol> ( </symbol>
- <expressionList>
- <expression>
- <term>
- <identifier> sum </identifier>
- </term>
- <symbol> / </symbol>
- <term>
- <identifier> length </identifier>
- </term>
- </expression>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <doStatement>
- <keyword> do </keyword>
- <identifier> Output </identifier>
- <symbol> . </symbol>
- <identifier> println </identifier>
- <symbol> ( </symbol>
- <expressionList>
- </expressionList>
- <symbol> ) </symbol>
- <symbol> ; </symbol>
- </doStatement>
- <returnStatement>
- <keyword> return </keyword>
- <symbol> ; </symbol>
- </returnStatement>
- </statements>
- <symbol> } </symbol>
- </subroutineBody>
- </subroutineDec>
- <symbol> } </symbol>
-</class>