Write a program that will allow user to choose to display traingles
and diamonds composed of asterisks ina lopping condition?
a. Display the traingles one below the other, like this:
*
**
***
****
*****
*****
****
***
**
*
*****
****
***
**
*
*
**
***
****
*****
b. Display the traingles side by side:
* ***** ***** *
** **** **** **
*** *** *** ***
**** ** ** ****
***** * * *****
c. Display diamond of the appropriate size (prompt the user to eneter
an odd integer and then use it to loop); if user enter 5:
*
***
*****
*******
*********
*******
*****
***
*
NOTE: I will use switch to allow selction; to make trangles and
diamonds, I want to use arrays in
the loop. If possible, I would like to make one or two methods of
making traingles (of different orienatation) and then call them to
display desired pattern. Any guide?
and diamonds composed of asterisks ina lopping condition?
a. Display the traingles one below the other, like this:
*
**
***
****
*****
*****
****
***
**
*
*****
****
***
**
*
*
**
***
****
*****
b. Display the traingles side by side:
* ***** ***** *
** **** **** **
*** *** *** ***
**** ** ** ****
***** * * *****
c. Display diamond of the appropriate size (prompt the user to eneter
an odd integer and then use it to loop); if user enter 5:
*
***
*****
*******
*********
*******
*****
***
*
NOTE: I will use switch to allow selction; to make trangles and
diamonds, I want to use arrays in
the loop. If possible, I would like to make one or two methods of
making traingles (of different orienatation) and then call them to
display desired pattern. Any guide?
Comment