Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions