Week 2 was again pretty straightforward, the first few exercise
were to do with printing a statement a certain amount of times based on the
while(condition). Further on, we are
told about the for-loop which makes this use of the while loop pretty useless.
The main outline of the week was around methods, and how
they use parameters given to them, and how different methods can call other
methods as their parameters.
The final few exercise
were slightly tricky. ‘Printing Like A Boss’ exercise number 40 had you create
a code, when called on, creates a Christmas tree like figure using ‘*’. The
main issue I had with this exercise was the math, how many ‘stars’ did each row
need. For example a tree of height 10.
Along with this, each tree had to print a stand of fixed stars, in the middle
of the tree.
This was the code that passed the tests, at this point, the code was very basic. |