Question
Java: DiamondChain project: -Ask user for the height or number of rows for the top half of the diamond. -you can assume that maxTopHeight will
Java:
DiamondChain project:
-Ask user for the height or number of rows for the top half of the diamond.
-you can assume that maxTopHeight will be an odd positive integer greater or equal to 3.
- The DiamondChain program will first print a diamond whose top-half height is 3 (total height of 6). The next diamond will have a top-half height of 5 (total height of 10), assuming maxTopHeight 5. The third diamond will have a top-half height of 7 (total height of 14), assuming maxTopHeight 7. Once the diamond with the greatest possible height has been printed, the program will start printing diamonds of descending heights in the reverse order. For instance, suppose that the maxTopHeight value is 11. Then, the top-half heights of the diamonds that will need to be printed in order will be: 3, 5, 7, 9, 11, 9, 7, 5, 3.
- If the user wishes to change the default border symbols, the program should additionally ask for the bottom left and bottom right characters
- You also want them to choose what character they want to make the diamond out of.
Here is a sample output:
Maximum number of rows for top half of diamond: 17 Character to display inside: Default border: / and Change? (y)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started