diff options
Diffstat (limited to '03_code2/README')
-rw-r--r-- | 03_code2/README | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/03_code2/README b/03_code2/README new file mode 100644 index 0000000..704aefc --- /dev/null +++ b/03_code2/README @@ -0,0 +1,34 @@ +Open the code2.c file you have in this directory. +You will see two functions: printTriangle and main. + +As with the previous problem, the printTriangle function +has an algorithm written as comments, but there is no code. +You should translate this algorithm to code. + +In main, there are three print statements which print out a triangle +with height 4, and the total number of stars in that triangle (returned +by the printTriangle function). + +There is also a comment asking you to write a few more statements +to do the same thing for a triangle of height 7. +Add the code to do this. + +When you have done this, run + +./test.sh + +As before, this script will try to compile your code (which you will learn about +ina n upcoming lesson), as well as run it. If your code does not have legal +syntax, it will do its best to describe what is wrong. If there +is a problem, look at the code and try to see where you did not follow +the syntax rules from Course 1 The line number and message it gives +may help you find the problem. If you cannot find the problem after a minute +or two, ask for help. + +If your code has legal syntax, test.sh will also run it, and show +you the output it produced, as well as the output we expected. + +If they are the same, you should commit, push, and grade. + +If they are not, you should see if you can fix the problem (and ask for help +if you cannot). |