HTW Berlin |
Exercise
5: Programming in the small
|
This week you will be working alone and practicing programming in the small.
Lab exercises
We are using Nick Parlante's Coding Bat for the first set of exercises. Please document which ones you did and record any problems you encountered solving the.
1 2 3 4 1---5----0----5----0----5----0----5----0 ???????????????????????????????????????? ???????????????????????????????????????? ??/= /= /= /= /=| ( ( ( ( +?? ??= /= /= /= /= | ( ( ( ( + ?? ?? /= /= /= /= /| ( ( ( (+ ?? -5 ??/= /= /= /= /=| ( ( ( +)))?? ??= /= /= /= /= | ( ( ( + ?? ?? /= /= /= /= /| ( ( ( + ?? ??/= /= /= /= /=| ( ( ( +))))))?? ??= /= /= /= /= | ( ( (+ ?? -10 ?? /= /= /= /= /| ( ( + ?? ??/= /= /= /= /=| ( ( +)))))))))?? ??= /= /= /= /= | ( ( + ?? ?? /= /= /= /= /| ( ( + ?? ??/= /= /= /= /=| ( (+))))))))))))?? -15 ??= /= /= /= /= | ( + ?? ??--------------- ( + ?? ?? ( ( ( ( +)))))))))))))))?? ?? ( ( ( ( + ?? ?? ( ( ( (+ ?? -20 ?? ( ( ( +))))))))))))))))))?? ?? ( ( ( + ?? ?? ( ( ( + ?? ?? ( ( ( +)))))))))))))))))))))?? ?? ( ( (+ ?? -25 ?? ( ( + ?? ?? ( ( +))))))))))))))))))))))))?? ?? ( ( + ?? ?? ( ( + ?? ?? ( (+)))))))))))))))))))))))))))?? -30 ?? ( + ?? ?? ( + ?? ?? ( +))))))))))))))))))))))))))))))?? ?? ( + ?? ?? (+ ?? -35 ?? +)))))))))))))))))))))))))))))))))?? ?? + ?? ??+ ?? ???????????????????????????????????????? ???????????????????????????????????????? -40
The method
public char determineCharacter (int column, int row);
needs implementation, so that it can be called from the nested loop
String outputLine; for (int row = 1; row <= 40; row++){ outputLine = ""; for (int column = 1; column <= 40; column++){
outputLine = outputLine+determineCharacter (column, row);
} System.out.println (outputLine);
} Document the body of the method in your report, including a screenshot of it working.
Your report is due by 10.00 pm the night before your next lab! Your report should include any collaborators, summarize what you learned, and note the time you invested in this exercise.