This is similar to programming challenge 4, from our book (page 106).
For this assignment you are going to write the code for the following class:
Here are the specifications of class Star:
Star must have 0 public INSTANCE variables.
Methods of class Star:
what it does: it prints the following pattern:
Note: in order to make the tests easier please don't print any spaces after each line of asterisks. If you do your code will not pass the tests even if the pattern looks the same as the above.
VERY IMPORTANT NOTE: if you need to use print and println methods your must use the methods
instead of System.out.print and System.out.println respectively. If you don't use the correct print methods your code will not pass the tests. Test05.print and Test05.println work in exactly the same way as System.out.print and System.out.println, they just have different names.
Read the instructions carefully:
- create a folder called Assignment05
- create a file called Star.java and save it in folder Assignment05
- download file Test05.class.zip (Test05_java6.class.zip) and put it in your folder Assignment05
- compile all java files in folder Assignment05
- type the following command in the DOS prompt window:
- tests will be run on your code and appropriate messages will be printed out showing which tests passed and which failed. At the end the program will tell you which option to choose in the moodle quizz corresponding to programming exercise 05