COMP1010 (D01) – Fall 2015 – Assignment 2 —Java Basic

COMP1010 (D01) – Fall 2015 – Assignment 2
Due: Oct 13, 2015, 11:59 PM
Material Covered:
 Loops
 Static Methods
Notes:
 Please follow the “Programming Standards” for all your works.
 Hand-in will be via the UMLearn Dropbox facility. Make sure you leave enough time before the deadline to ensure your hand-in works properly.
 Keep in mind that the UMLearn Dropbox facility will only keep the most recent submission. Therefore, if you want to update your submission, make sure you re-upload ALL your assignment files.
Question 1: Star Patterns (version 2)
We saw this question in Assignment 1, now let’s spice it up a little bit. 🙂
Write a program that uses loops to displays the following patterns:
*******
* *****
* ****
* ***
* **
* *
*******
Different from the question in Assignment 1, here are two extra rules:
1. You are allowed to use at most 5 System.out.print() (or println()) in your code. (Exclude the print for “End of processing…” at the end)
2. Each System.out.print() (or println()) can only output 1 ch

Leave a Reply

Your email address will not be published. Required fields are marked *