Problem definition

Create a program called diamond.java, which outputs the diamond pattern below.

diamond

You may use an output statement that print one asterisk, an output statement that prints a single space, and an output statement to create a new line.Use your knowledge of nested loops to solve this problem.

For bonus points, modify the program so that it accepts an integer between 1-20 from the user . Using this integer output a diamond shape with the inputted number of rows.
   

Additional information


 Check the Java Code.

   

Programming Tip


 
Use the same logic as the triangle exercise. Make sure you create another variable for spacing. It may help to sketch out the
 pattern and count the number of row, stars, and spaces, in order to figure out the math.


Standards being assessed

Constructively uses structures/processes and protocols of programming.  

(2)  

Constructs effective algorithms and simulates them in project work.          

(1)

Applies and uses techniques, principles and systems of computing.           

(1)

Research skills                                                                                      

(2)

Completes assignments on time                                                              

(1)

 

Assigned date : September 6, 2007   ;    Due date : September 10, 2007