B
Bert
How can my response to this problem be better? The pot doesn't work
that well when you enter 25, 21, 17 and some others.
The problem:
CHRISTMAS TREES
The grade 5 class at the local primary school wants some Christmas
tree outlines to colour in for the break-up session. You have to
write a program which will ask for an odd number representing the size
of the tree, rejecting negative quantities and numbers greater than
sixty, and then draw a tree centrally placed on the printer page
similar to the one below.
*
* *
* *
* *
* *
* *
* *
Base Line---> ***************
*
*
*******
* *
* *
***
The base line of the tree will be made of as many asterisks (*) as the
number that was input, and lines above it will have each of the
outline asterisks move in one space, until the single * appears at the
top.
The pot in which the tree rests should be scaled to suit the tree
size.
Download MY source code from:
Click on treetest
that well when you enter 25, 21, 17 and some others.
The problem:
CHRISTMAS TREES
The grade 5 class at the local primary school wants some Christmas
tree outlines to colour in for the break-up session. You have to
write a program which will ask for an odd number representing the size
of the tree, rejecting negative quantities and numbers greater than
sixty, and then draw a tree centrally placed on the printer page
similar to the one below.
*
* *
* *
* *
* *
* *
* *
Base Line---> ***************
*
*
*******
* *
* *
***
The base line of the tree will be made of as many asterisks (*) as the
number that was input, and lines above it will have each of the
outline asterisks move in one space, until the single * appears at the
top.
The pot in which the tree rests should be scaled to suit the tree
size.
Download MY source code from:
Click on treetest